Constructor
new TileInfo(posopt, sizeopt, textureInfoopt, paddingopt, bleedopt)
Create a tile info object
| 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 all sides of each tile (increases grid size, does not affect tile size) | |
bleed | number | <optional> | How many pixels smaller to shrink UVS of tiles (does not affect grid size, only UVs) |
- 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
| Name | Type | Description |
|---|---|---|
frame | number | Offset to apply in animation frames |
- Source
- Type:
- TileInfo
offset(offset) → {TileInfo}
Returns a copy of this tile offset by a vector
| Name | Type | Description |
|---|---|---|
offset | Vector2 | Offset to apply in pixels |
- Source
- Type:
- TileInfo
setFullImage(textureInfoopt) → {TileInfo}
Set this tile to use a full image in a texture info
| Name | Type | Attributes | Description |
|---|---|---|---|
textureInfo | TextureInfo | <optional> |
- Source
- Type:
- TileInfo
tile(indexopt) → {TileInfo}
Returns a tile info for an index using this tile as reference
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
index | Vector2 | | <optional> | 0 |
- Source
- Type:
- TileInfo