public/js-roguelike-skeleton/src/renderer.js
function(x, y){
            var pos = this.canvas.getBoundingClientRect(),
                mx = x - pos.left,
                my = y - pos.top;
            return this.pixelToTileCoords(mx, my);
        }
function(x, y){
            var pos = this.canvas.getBoundingClientRect(),
                mx = x - pos.left,
                my = y - pos.top;
            return this.pixelToTileCoords(mx, my);
        }
function ( x , y ) { var pos = this . canvas . getBoundingClientRect ( ) , mx = x - pos . left , my = y - pos . top ; return this . pixelToTileCoords ( mx , my ) ; }
Converts mouse pixel coords to map tile coords. Mouse pixel coords must be relative to the current window.
@method mouseToTileCoords
@param {Number} x - Mouse pixel x coord.
@param {Number} y - Mouse pixel y coord.
@return {Object|False} {x: 0, y: 0}
Converts mouse pixel coords to map tile coords . Mouse pixel coords must be relative to the current window .