Skip to content

Instantly share code, notes, and snippets.

View monteslu's full-sized avatar
:shipit:
crushing all the code. Mostly into reusable modules, tho

Luis Montes monteslu

:shipit:
crushing all the code. Mostly into reusable modules, tho
View GitHub Profile
@monteslu
monteslu / gist:5828029
Created June 21, 2013 00:42
propeller
{
"entities": [
{
"points": [
{
"x": -137.33333333333334,
"y": -119.66666666666666
},
{
"x": 276.66666666666663,
@monteslu
monteslu / fun.json
Last active December 12, 2015 10:09
some more json for the editor
{
"entities": [
{
"x": 427.5,
"y": 606.5,
"halfWidth": 425.5,
"halfHeight": 16.5,
"staticBody": true,
"zone": false,
"type": "Rectangle",
{
"entities": [
{
"x": 1,
"y": 238,
"halfWidth": 12.5,
"halfHeight": 256,
"staticBody": true,
"zone": false,
"type": "Rectangle",
define([
], function(){
return function(gfxSurfaceW, gfxSurfaceH, canvasW, canvasH, borderThickness, textOffset){
var surfaceRatio = (gfxSurfaceW * 1.0) / (gfxSurfaceH * 1.0);
var canvasRatio = (canvasW * 1.0) / (canvasH * 1.0);
if(canvasRatio > surfaceRatio){
//stick box to left
var xRemaining = gfxSurfaceW - (textOffset * 2);
var pxPerInch = xRemaining / (canvasW + (borderThickness * 2));
var x = (borderThickness * pxPerInch) + textOffset;
@monteslu
monteslu / demo.html
Created October 13, 2010 22:51
demo
<html>
<body>
playing with gist
</body>
</html>