Represents a single sprite in an SPA animation. Note that a single sprite isn't always a single frame; one sprite can contain multiple frames itself. The frames are stored on the sprite from top to bottom, left to right. I.e. The first frame is in the top left corner; the next is below it. If there is no more height left, the next frame is at the top again but one column further right.
Public Member Functions | |
SPASprite (SPA animation, int id) | |
Creates an empty sprite. More... | |
SPASprite (SPA animation, SPAReader reader, int id) | |
Loads a new sprite from the given binary stream. More... | |
void | SetSprite (Texture2D sprite, int totalFrameCount) |
Sets the given sprite texture to this SPA sprite. More... | |
Public Attributes | |
int | ID |
Which number sprite this is in the spa. Starts from 0. More... | |
int | Width |
The width of the sprite. More... | |
int | Height |
The height of the sprite. More... | |
float | Delay |
The delay to apply for this particular sprite. More... | |
SPA | Animation |
The animation this sprite belongs to. More... | |
int | FrameCount |
How many frames this sprite holds. More... | |
Texture2D | Sprite |
The sprite graphic itself. More... | |
Vector2 | TextureScale |
The scale of the sprite that should be used when the sprite is applied to a material. More... | |
int | VerticalFrameCount |
How many frames are down the height of the image.Sprite height/Frame height. More... | |
Properties | |
Blaze.TextureAtlas | Atlas [get] |
Gets this sprite as a texture atlas. More... | |
Private Attributes | |
Blaze.TextureAtlas | LoadedAtlas |
An already created texture atlas. More... | |
|
inline |
Creates an empty sprite.
Loads a new sprite from the given binary stream.
animation | The animation this sprite belongs to. |
reader | The binary stream that contains this sprites data. |
id | The ID of the sprite in the animation. |
|
inline |
Sets the given sprite texture to this SPA sprite.
SPA Spa.SPASprite.Animation |
The animation this sprite belongs to.
float Spa.SPASprite.Delay |
The delay to apply for this particular sprite.
int Spa.SPASprite.FrameCount |
How many frames this sprite holds.
int Spa.SPASprite.Height |
The height of the sprite.
int Spa.SPASprite.ID |
Which number sprite this is in the spa. Starts from 0.
|
private |
An already created texture atlas.
Texture2D Spa.SPASprite.Sprite |
The sprite graphic itself.
Vector2 Spa.SPASprite.TextureScale |
The scale of the sprite that should be used when the sprite is applied to a material.
int Spa.SPASprite.VerticalFrameCount |
How many frames are down the height of the image.Sprite height/Frame height.
int Spa.SPASprite.Width |
The width of the sprite.
|
get |
Gets this sprite as a texture atlas.