Nez.Portable/PipelineRuntime/Tiled/TiledMap.cs
/// <summary>
/// converts from world to tile position clamping to the tilemap bounds
/// </summary>
/// <returns>The to tile position x.</returns>
/// <param name="x">The x coordinate.</param>
converts from world to tile position clamping to the tilemap bounds
converts from world to tile position clamping to the tilemap bounds
public int worldToTilePositionX(float x, bool clampToTilemapBounds = true)
        {
            var tileX = Mathf.fastFloorToInt(x / tileWidth);
            if (!clampToTilemapBounds)
                return tileX;
            return Mathf.clamp(tileX, 0, width - 1);
        }
public int worldToTilePositionX ( float x , bool clampToTilemapBounds = true ) { var tileX = Mathf . fastFloorToInt ( x / tileWidth ) ; if ( ! clampToTilemapBounds ) return tileX ; return Mathf . clamp ( tileX , 0 , width - 1 ) ; }
converts from world to tile position clamping to the tilemap bounds
converts from world to tile position clamping to the tilemap bounds
The to tile position x.
The to tile position x .
x
float
The x coordinate.
The x coordinate .
clampToTilemapBounds
bool