C# Class GameEngine.Tiled.TiledMap

Inheritance: PropertyBag, ILoadable
Afficher le fichier Open project: MichaelAquilina/Some-2D-RPG Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
ConvertToPointsList ( string pointData ) : List

Method Details

GetObjectLayerByName() public méthode

public GetObjectLayerByName ( string name ) : TiledObjectLayer
name string
Résultat TiledObjectLayer

GetPxTile() public méthode

public GetPxTile ( float px, float py, int layerIndex ) : Tile
px float
py float
layerIndex int
Résultat Tile

GetPxTopMostTile() public méthode

public GetPxTopMostTile ( Vector2 pos ) : Tile
pos Vector2
Résultat Tile

GetPxTopMostTile() public méthode

public GetPxTopMostTile ( float px, float py ) : Tile
px float
py float
Résultat Tile

GetTileBounds() public méthode

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
Résultat Microsoft.Xna.Framework.Rectangle

GetTileLayerByName() public méthode

public GetTileLayerByName ( string name ) : TileLayer
name string
Résultat TileLayer

GetTxTile() public méthode

public GetTxTile ( int tx, int ty, int layerIndex ) : Tile
tx int
ty int
layerIndex int
Résultat Tile

GetTxTopMostTile() public méthode

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.
Résultat Tile

LoadContent() public méthode

public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager
Résultat void

LoadTmxFile() public static méthode

public static LoadTmxFile ( string file ) : TiledMap
file string
Résultat TiledMap

PxToTx() public méthode

Converts the specfied global world (px) coordinates into its relevant tile coordinate.
public PxToTx ( Vector2 position ) : Vector2
position Vector2
Résultat Vector2

TiledMap() public méthode

public TiledMap ( ) : System
Résultat System

ToString() public méthode

public ToString ( ) : string
Résultat string

TxToPx() public méthode

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
Résultat Vector2