Constructor
new TileInfo(posopt, sizeopt, textureIndexopt, paddingopt, bleedScaleopt)
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 |
bleedScale | number | <optional> | How many pixels smaller to draw tiles |
- Source
Members
bleedScale
PropertiesType | Description |
---|---|
float | Shrinks tile by this many pixels to prevent neighbors bleeding |
- Source
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
textureInfo
PropertiesType | 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(image, glTextureopt) → {TileInfo}
Set this tile to use a full image
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
image | HTMLImageElement | | ||
glTexture | WebGLTexture | <optional> | WebGL texture |
- Source
Returns:
- Type:
- TileInfo