C# Класс GameEngine.Tiled.TiledMap

Наследование: PropertyBag, ILoadable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetObjectLayerByName ( string name ) : TiledObjectLayer
GetPxTile ( float px, float py, int layerIndex ) : Tile
GetPxTopMostTile ( Vector2 pos ) : Tile
GetPxTopMostTile ( float px, float py ) : Tile
GetTileBounds ( Vector2 txPos ) : Rectangle

Returns the rectangular bounds for the tile at the specified coordinate. The coordinate passed should in tile coordinates (TX) rather than map pixel coordinates (PX).

GetTileLayerByName ( string name ) : TileLayer
GetTxTile ( int tx, int ty, int layerIndex ) : Tile
GetTxTopMostTile ( int tx, int ty ) : Tile

Retrieves the Topmost tile at the specified (X,Y) location on the map. By top most, the function refers to the draw order, i.e. the tile which would be shown on top. The first non-zero tile found from the top will be returned by this function. Tiles found in Tile layers marked as "Foreground" are not included. If no non-zero tile is found in any layer, then a null value is returned.

LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
LoadTmxFile ( string file ) : TiledMap
PxToTx ( Vector2 position ) : Vector2

Converts the specfied global world (px) coordinates into its relevant tile coordinate.

TiledMap ( ) : System
ToString ( ) : string
TxToPx ( Vector2 position, bool center = true ) : Vector2

Converts the specified tile (tx) coordinates into global world (px) coordinates. The result returned will be situated at the very center for the specified tile coordinate if the center parameter is specified as true.

Приватные методы

Метод Описание
ConvertToPointsList ( string pointData ) : List

Описание методов

GetObjectLayerByName() публичный Метод

public GetObjectLayerByName ( string name ) : TiledObjectLayer
name string
Результат TiledObjectLayer

GetPxTile() публичный Метод

public GetPxTile ( float px, float py, int layerIndex ) : Tile
px float
py float
layerIndex int
Результат Tile

GetPxTopMostTile() публичный Метод

public GetPxTopMostTile ( Vector2 pos ) : Tile
pos Vector2
Результат Tile

GetPxTopMostTile() публичный Метод

public GetPxTopMostTile ( float px, float py ) : Tile
px float
py float
Результат Tile

GetTileBounds() публичный Метод

Returns the rectangular bounds for the tile at the specified coordinate. The coordinate passed should in tile coordinates (TX) rather than map pixel coordinates (PX).
public GetTileBounds ( Vector2 txPos ) : Rectangle
txPos Vector2
Результат Microsoft.Xna.Framework.Rectangle

GetTileLayerByName() публичный Метод

public GetTileLayerByName ( string name ) : TileLayer
name string
Результат TileLayer

GetTxTile() публичный Метод

public GetTxTile ( int tx, int ty, int layerIndex ) : Tile
tx int
ty int
layerIndex int
Результат Tile

GetTxTopMostTile() публичный Метод

Retrieves the Topmost tile at the specified (X,Y) location on the map. By top most, the function refers to the draw order, i.e. the tile which would be shown on top. The first non-zero tile found from the top will be returned by this function. Tiles found in Tile layers marked as "Foreground" are not included. If no non-zero tile is found in any layer, then a null value is returned.
public GetTxTopMostTile ( int tx, int ty ) : Tile
tx int integer X value.
ty int integer Y value.
Результат Tile

LoadContent() публичный Метод

public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager
Результат void

LoadTmxFile() публичный статический Метод

public static LoadTmxFile ( string file ) : TiledMap
file string
Результат TiledMap

PxToTx() публичный Метод

Converts the specfied global world (px) coordinates into its relevant tile coordinate.
public PxToTx ( Vector2 position ) : Vector2
position Vector2
Результат Vector2

TiledMap() публичный Метод

public TiledMap ( ) : System
Результат System

ToString() публичный Метод

public ToString ( ) : string
Результат string

TxToPx() публичный Метод

Converts the specified tile (tx) coordinates into global world (px) coordinates. The result returned will be situated at the very center for the specified tile coordinate if the center parameter is specified as true.
public TxToPx ( Vector2 position, bool center = true ) : Vector2
position Vector2
center bool
Результат Vector2