Constructor
new TileInfo(posopt, sizeopt, textureIndexopt, paddingopt)
Create a tile info object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos | Vector2 | <optional> | (0,0) | Top left corner of tile in pixels |
size | Vector2 | <optional> | tileSizeDefault | Size of tile in pixels |
textureIndex | Number | <optional> | 0 | Texture index to use |
padding | Number | <optional> | 0 | How many pixels padding around tiles |
- Source
Members
padding
PropertiesType | Description |
---|---|
Number | How many pixels padding around tiles |
- Source
pos
PropertiesType | Description |
---|---|
Vector2 | Top left corner of tile in pixels |
- Source
size
PropertiesType | Description |
---|---|
Vector2 | Size of tile in pixels |
- Source
textureIndex
PropertiesType | Description |
---|---|
Number | Texture index to use |
- Source
Methods
frame(frame) → {TileInfo}
Returns a copy of this tile offset by a number of animation frames
Parameters:
Name | Type | Description |
---|---|---|
frame | Number | Offset to apply in animation frames |
- Source
Returns:
- Type:
- TileInfo
getTextureInfo() → {TextureInfo}
Returns the texture info for this tile
- Source
Returns:
- Type:
- TextureInfo
offset(offset) → {TileInfo}
Returns a copy of this tile offset by a vector
Parameters:
Name | Type | Description |
---|---|---|
offset | Vector2 | Offset to apply in pixels |
- Source
Returns:
- Type:
- TileInfo