This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function map(x, in_min, in_max, out_min, out_max) { | |
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is NOT DOM events (click, mouseover, touchend, etc...) | |
* This is custom events, which can be bound to anything. | |
*/ | |
var ee = function(){}; | |
//bind function to event | |
ee.prototype.on = function(key, fn){ | |
//if not function, bail | |
if(typeof fn !== 'function'){ return false; } |
NewerOlder