Constructor
new TileInfo(posopt, sizeopt, textureInfoopt, paddingopt, bleedopt)
Create a tile info object
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
pos | Vector2 | <optional> | vec2() | Top left corner of tile in pixels |
size | Vector2 | <optional> | Size of tile in pixels | |
textureInfo | TextureInfo | <optional> | Texture info to use | |
padding | number | <optional> | How many pixels padding around tiles | |
bleed | number | <optional> | How many pixels smaller to draw tiles |
- Source
Members
bleed
Properties| Type | Description |
|---|---|
| number | Shrinks tile by this many pixels to prevent neighbors bleeding |
- Source
padding
Properties| Type | Description |
|---|---|
| number | How many pixels padding around tiles |
- Source
pos
Properties| Type | Description |
|---|---|
| Vector2 | Top left corner of tile in pixels |
- Source
size
Properties| Type | Description |
|---|---|
| Vector2 | Size of tile in pixels |
- Source
textureInfo
Properties| Type | Description |
|---|---|
| TextureInfo | The texture info for this tile |
- 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
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
setFullImage(textureInfoopt) → {TileInfo}
Set this tile to use a full image in a texture info
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
textureInfo | TextureInfo | <optional> |
- Source
Returns:
- Type:
- TileInfo
tile(indexopt) → {TileInfo}
Returns a tile info for an index using this tile as refrence
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
index | Vector2 | | <optional> | 0 |
- Source
Returns:
- Type:
- TileInfo