Arcade
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
GameAPI.BudgetBoy.Tilemap Class Reference

Rendering primitive representing a uniform grid of tiles. Each tile is represented by an Image and a Swatch to use when rendering it, or a null Image for an empty tile. More...

Inheritance diagram for GameAPI.BudgetBoy.Tilemap:
GameAPI.BudgetBoy.IRenderable

Public Member Functions

 Tilemap (Vector2I tileSize, Vector2I dimensions)
 Construct a tilemap with the specified tile size and dimensions. More...
 
void ClearTile (int col, int row)
 Clear the image at the specified column and row. More...
 
void SetTile (int col, int row, Image image, SwatchIndex swatchIndex)
 Set the image and swatch index at the specified column and row. More...
 
void SetTile (int col, int row, Image image, SwatchIndex swatchIndex, bool flipX, bool flipY)
 Set the image and swatch index at the specified column and row with flipping options. More...
 
void SetTileSwatch (int col, int row, SwatchIndex swatchIndex)
 
void Render (Graphics graphics)
 Render to screen. More...
 

Properties

Vector2I TileSize [get]
 Width and Height of each tile. More...
 
int TileWidth [get]
 Width of tiles. More...
 
int TileHeight [get]
 Height of tiles. More...
 
Vector2I Dimensions [get]
 Column and row count. More...
 
int Columns [get]
 Column count. More...
 
int Rows [get]
 Row count. More...
 
Vector2I Size [get]
 Pixel width and height of the tilemap. More...
 
int Width [get]
 Pixel width of the tilemap. More...
 
int Height [get]
 Pixel height of the tilemap. More...
 
Vector2I Position [get, set]
 Local integer position. More...
 
int X [get, set]
 Local integer x-position. More...
 
int Y [get, set]
 Local integer y-position. More...
 
RectF Bounds [get]
 Local rect bounds. More...
 

Detailed Description

Rendering primitive representing a uniform grid of tiles. Each tile is represented by an Image and a Swatch to use when rendering it, or a null Image for an empty tile.

Constructor & Destructor Documentation

GameAPI.BudgetBoy.Tilemap.Tilemap ( Vector2I  tileSize,
Vector2I  dimensions 
)
inline

Construct a tilemap with the specified tile size and dimensions.

Parameters
tileSizeThe pixel size of each tile.
dimensionsThe size in tiles of the tilemap (the number of tiles in each row, and the number of tiles in each column).

Member Function Documentation

void GameAPI.BudgetBoy.Tilemap.ClearTile ( int  col,
int  row 
)
inline

Clear the image at the specified column and row.

Parameters
colThe x-position of the tile to clear.
rowThe y-position of the tile to clear.
void GameAPI.BudgetBoy.Tilemap.Render ( Graphics  graphics)
inline

Render to screen.

Parameters
graphicsThe Graphics context of the Game.

Implements GameAPI.BudgetBoy.IRenderable.

void GameAPI.BudgetBoy.Tilemap.SetTile ( int  col,
int  row,
Image  image,
SwatchIndex  swatchIndex 
)
inline

Set the image and swatch index at the specified column and row.

Parameters
colThe x-position of the tile to clear.
rowThe y-position of the tile to clear.
imageThe Image to render for the tile.
swatchIndexThe SwatchIndex used to color the tile.
void GameAPI.BudgetBoy.Tilemap.SetTile ( int  col,
int  row,
Image  image,
SwatchIndex  swatchIndex,
bool  flipX,
bool  flipY 
)
inline

Set the image and swatch index at the specified column and row with flipping options.

Parameters
colThe x-position of the tile to clear.
rowThe y-position of the tile to clear.
imageThe Image to render for the tile.
swatchIndexThe SwatchIndex used to color the tile.
flipXShould the Image for this tile be flipped horizontally?
flipYShould the Image for this tile be flipped vertically?
void GameAPI.BudgetBoy.Tilemap.SetTileSwatch ( int  col,
int  row,
SwatchIndex  swatchIndex 
)
inline

Property Documentation

RectF GameAPI.BudgetBoy.Tilemap.Bounds
get

Local rect bounds.

int GameAPI.BudgetBoy.Tilemap.Columns
get

Column count.

Vector2I GameAPI.BudgetBoy.Tilemap.Dimensions
get

Column and row count.

int GameAPI.BudgetBoy.Tilemap.Height
get

Pixel height of the tilemap.

Vector2I GameAPI.BudgetBoy.Tilemap.Position
getset

Local integer position.

int GameAPI.BudgetBoy.Tilemap.Rows
get

Row count.

Vector2I GameAPI.BudgetBoy.Tilemap.Size
get

Pixel width and height of the tilemap.

int GameAPI.BudgetBoy.Tilemap.TileHeight
get

Height of tiles.

Vector2I GameAPI.BudgetBoy.Tilemap.TileSize
get

Width and Height of each tile.

int GameAPI.BudgetBoy.Tilemap.TileWidth
get

Width of tiles.

int GameAPI.BudgetBoy.Tilemap.Width
get

Pixel width of the tilemap.

int GameAPI.BudgetBoy.Tilemap.X
getset

Local integer x-position.

int GameAPI.BudgetBoy.Tilemap.Y
getset

Local integer y-position.