src/level/tiled/TMXLayer.js
function (x, y) {
            if (this.containsPoint(x, y)) {
                var renderer = this.renderer;
                var tile = null;
                var coord = renderer.pixelToTileCoords(x, y, me.pool.pull("me.Vector2d"));
                if ((coord.x >= 0 && coord.x < renderer.cols) && ( coord.y >= 0 && coord.y < renderer.rows)) {
                    tile = this.layerData[~~coord.x][~~coord.y];
                }
                me.pool.push(coord);
            }
            return tile;
        }
function (x, y) {
            if (this.containsPoint(x, y)) {
                var renderer = this.renderer;
                var tile = null;
                var coord = renderer.pixelToTileCoords(x, y, me.pool.pull("me.Vector2d"));
                if ((coord.x >= 0 && coord.x < renderer.cols) && ( coord.y >= 0 && coord.y < renderer.rows)) {
                    tile = this.layerData[~~coord.x][~~coord.y];
                }
                me.pool.push(coord);
            }
            return tile;
        }
function ( x , y ) { if ( this . containsPoint ( x , y ) ) { var renderer = this . renderer ; var tile = null ; var coord = renderer . pixelToTileCoords ( x , y , me . pool . pull ( "me.Vector2d" ) ) ; if ( ( coord . x >= 0 && coord . x < renderer . cols ) && ( coord . y >= 0 && coord . y < renderer . rows ) ) { tile = this . layerData [ ~ ~ coord . x ] [ ~ ~ coord . y ] ; } me . pool . push ( coord ) ; } return tile ; }
Return the Tile object at the specified position
@name getTile
@memberOf me.TMXLayer
@public
@function
@param {Number} x X coordinate (in world/pixels coordinates)
@param {Number} y Y coordinate (in world/pixels coordinates)
@return {me.Tile} corresponding tile or null if outside of the map area
@example
// get the TMX Map Layer called "Front layer"
var layer = me.game.world.getChildByName("Front Layer")[0];
// get the tile object corresponding to the latest pointer position
var tile = layer.getTile(me.input.pointer.pos.x, me.input.pointer.pos.y);
Return the Tile object at the specified position