SpriteTile is a sprite for which you specify a tile index (1D or 2D) in a TextureInfo. More...
Public Member Functions | |
SpriteTile () | |
SpriteTile constructor. | |
SpriteTile (TextureInfo texture_info) | |
SpriteTile constructor. | |
SpriteTile (TextureInfo texture_info, Vector2i index) | |
SpriteTile constructor. | |
SpriteTile (TextureInfo texture_info, int index) | |
SpriteTile constructor. | |
override Vector2 | CalcSizeInPixels () |
Based on the uv and texture dimensions, return the corresponding size in pixels. | |
Public Attributes | |
Vector2i | TileIndex2D = new Vector2i(0,0) |
TileIndex2D defines the UV that will be used for this sprite. | |
Properties | |
int | TileIndex1D [get, set] |
Instead of TileIndex2D you can also work with a flattened 1d index, for animation, etc. |
SpriteTile is a sprite for which you specify a tile index (1D or 2D) in a TextureInfo.
Note that the cost of using SpriteUV alone is heavy, try as much as you can to use then as children of SpriteList.
SpriteTile | ( | ) |
SpriteTile constructor.
TileIndex2D is set to (0,0) by default.
SpriteTile | ( | TextureInfo | texture_info | ) |
SpriteTile constructor.
TileIndex2D is set to (0,0) by default.
SpriteTile | ( | TextureInfo | texture_info, |
Vector2i | index | ||
) |
SpriteTile constructor.
TileIndex2D is set to (0,0) by default.
texture_info | The tiled texture object. |
index | 2D tile index. (0,0) is the bottom left tile. |
SpriteTile | ( | TextureInfo | texture_info, |
int | index | ||
) |
SpriteTile constructor.
texture_info | The tiled texture object. |
index | 1D tile index. Flat indexing starts from bottom left tile, which is (0,0) in 2D. |
override Vector2 CalcSizeInPixels | ( | ) | [virtual] |
Based on the uv and texture dimensions, return the corresponding size in pixels.
For example you might want to do something like bob.Quad.S = bob.CalcSizeInPixels().
Implements SpriteBase.
Vector2i TileIndex2D = new Vector2i(0,0) |
TileIndex2D defines the UV that will be used for this sprite.
Tiles are indexed in 2 dimensions.
int TileIndex1D [get, set] |
Instead of TileIndex2D you can also work with a flattened 1d index, for animation, etc.
In that case the set/get calculation depend on TextureInfo, so TextureInfo must have been set properly.