getTilePos: function (posInPixel) {
var mapSize = this.map.getContentSize();
var tileSize = this.map.getTileSize();
var x = Math.floor(posInPixel.x / tileSize.width);
var y = Math.floor((mapSize.height - posInPixel.y) / tileSize.height);
return cc.p(x, y);
}
网友评论