TileInfo

Tile Info - Stores info about how to draw a tile

Constructor

new TileInfo(posopt, sizeopt, textureIndexopt, paddingopt)

Create a tile info object

Parameters:
NameTypeAttributesDefaultDescription
posVector2<optional>
(0,0)

Top left corner of tile in pixels

sizeVector2<optional>
tileSizeDefault

Size of tile in pixels

textureIndexNumber<optional>
0

Texture index to use

paddingNumber<optional>
0

How many pixels padding around tiles

Members

padding

Properties
TypeDescription
Number

How many pixels padding around tiles

pos

Properties
TypeDescription
Vector2

Top left corner of tile in pixels

size

Properties
TypeDescription
Vector2

Size of tile in pixels

textureIndex

Properties
TypeDescription
Number

Texture index to use

Methods

frame(frame) → {TileInfo}

Returns a copy of this tile offset by a number of animation frames

Parameters:
NameTypeDescription
frameNumber

Offset to apply in animation frames

Returns:
Type: 
TileInfo

getTextureInfo() → {TextureInfo}

Returns the texture info for this tile

Returns:
Type: 
TextureInfo

offset(offset) → {TileInfo}

Returns a copy of this tile offset by a vector

Parameters:
NameTypeDescription
offsetVector2

Offset to apply in pixels

Returns:
Type: 
TileInfo