Esempio n. 1
0
        /// <summary>
        /// note that world position assumes that the Vector2 was normalized to be in the tilemaps coordinates. i.e. if the tilemap
        /// is not at 0,0 then the world position should be moved so that it takes into consideration the tilemap offset from 0,0.
        /// Example: if the tilemap is at 300,300 then the passed in value should be worldPos - (300,300)
        /// </summary>
        /// <returns>The tile at world position.</returns>
        /// <param name="pos">Position.</param>
        public TiledTile getTileAtWorldPosition(Vector2 pos)
        {
            Point tilePos = tiledMap.isometricWorldToTilePosition(pos);

            return(getTile(tilePos.X, tilePos.Y));
        }