Detailed Description

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.

Inheritance diagram for Spa.SPASprite:
Gif.GifFrame

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...
 

Constructor & Destructor Documentation

Spa.SPASprite.SPASprite ( SPA  animation,
int  id 
)
inline

Creates an empty sprite.

Spa.SPASprite.SPASprite ( SPA  animation,
SPAReader  reader,
int  id 
)
inline

Loads a new sprite from the given binary stream.

Parameters
animationThe animation this sprite belongs to.
readerThe binary stream that contains this sprites data.
idThe ID of the sprite in the animation.

Member Function Documentation

void Spa.SPASprite.SetSprite ( Texture2D  sprite,
int  totalFrameCount 
)
inline

Sets the given sprite texture to this SPA sprite.

Member Data Documentation

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.

Blaze.TextureAtlas Spa.SPASprite.LoadedAtlas
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.

Property Documentation

Blaze.TextureAtlas Spa.SPASprite.Atlas
get

Gets this sprite as a texture atlas.