All Classes Functions Variables Enumerations Properties Events
Public Member Functions | Public Attributes
tk2dTileMap Class Reference

Tile Map. More...

Inherits tk2dRuntime.ISpriteCollectionForceBuild.

List of all members.

Public Member Functions

bool GetTileAtPosition (Vector3 position, out int x, out int y)
 Gets the tile coordinate at position. This can be used to obtain tile or color data explicitly from layers Returns true if the position is within the tilemap bounds.
bool GetTileFracAtPosition (Vector3 position, out float x, out float y)
 Gets the tile coordinate at position. This can be used to obtain tile or color data explicitly from layers The fractional value returned is the fraction into the current tile Returns true if the position is within the tilemap bounds.
Vector3 GetTilePosition (int x, int y)
 Returns the tile position in world space.
int GetTileIdAtPosition (Vector3 position, int layer)
 Gets the tile at position. This can be used to obtain tile data, etc -1 = no data or empty tile.
tk2dRuntime.TileMap.TileInfo GetTileInfoForTileId (int tileId)
 Returns the tile info chunk for the tile. Use this to store additional metadata.
Color GetInterpolatedColorAtPosition (Vector3 position)
 Gets the tile at position. This can be used to obtain tile data, etc -1 = no data or empty tile.

Public Attributes

string editorDataGUID = ""
 This is a link to the editor data object (tk2dTileMapEditorData). It contains presets, and other data which isn't really relevant in game.
tk2dTileMapData data
 Tile map data, stores shared parameters for tilemaps.
GameObject renderData
 Tile map render and collider object.
int width = 128
 Width of the tilemap.
int height = 128
 Height of the tilemap.
int partitionSizeX = 32
 X axis partition size for this tilemap.
int partitionSizeY = 32
 Y axis partition size for this tilemap.

Detailed Description

Tile Map.


Member Function Documentation

Color tk2dTileMap.GetInterpolatedColorAtPosition ( Vector3  position)

Gets the tile at position. This can be used to obtain tile data, etc -1 = no data or empty tile.

bool tk2dTileMap.GetTileAtPosition ( Vector3  position,
out int  x,
out int  y 
)

Gets the tile coordinate at position. This can be used to obtain tile or color data explicitly from layers Returns true if the position is within the tilemap bounds.

bool tk2dTileMap.GetTileFracAtPosition ( Vector3  position,
out float  x,
out float  y 
)

Gets the tile coordinate at position. This can be used to obtain tile or color data explicitly from layers The fractional value returned is the fraction into the current tile Returns true if the position is within the tilemap bounds.

int tk2dTileMap.GetTileIdAtPosition ( Vector3  position,
int  layer 
)

Gets the tile at position. This can be used to obtain tile data, etc -1 = no data or empty tile.

tk2dRuntime.TileMap.TileInfo tk2dTileMap.GetTileInfoForTileId ( int  tileId)

Returns the tile info chunk for the tile. Use this to store additional metadata.

Vector3 tk2dTileMap.GetTilePosition ( int  x,
int  y 
)

Returns the tile position in world space.


Member Data Documentation

tk2dTileMapData tk2dTileMap.data

Tile map data, stores shared parameters for tilemaps.

This is a link to the editor data object (tk2dTileMapEditorData). It contains presets, and other data which isn't really relevant in game.

int tk2dTileMap.height = 128

Height of the tilemap.

X axis partition size for this tilemap.

Y axis partition size for this tilemap.

Tile map render and collider object.

int tk2dTileMap.width = 128

Width of the tilemap.