PowerUI.SPASprite Class Reference

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.

Public Member Functions

 SPASprite (SPA animation, int id)
 Creates an empty sprite. More...
 
 SPASprite (SPA animation, BinaryReader 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...
 
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...
 

Constructor & Destructor Documentation

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

Creates an empty sprite.

PowerUI.SPASprite.SPASprite ( SPA  animation,
BinaryReader  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 PowerUI.SPASprite.SetSprite ( Texture2D  sprite,
int  totalFrameCount 
)
inline

Sets the given sprite texture to this SPA sprite.

Member Data Documentation

SPA PowerUI.SPASprite.Animation

The animation this sprite belongs to.

int PowerUI.SPASprite.FrameCount

How many frames this sprite holds.

int PowerUI.SPASprite.Height

The height of the sprite.

int PowerUI.SPASprite.ID

Which number sprite this is in the spa. Starts from 0.

Texture2D PowerUI.SPASprite.Sprite

The sprite graphic itself.

Vector2 PowerUI.SPASprite.TextureScale

The scale of the sprite that should be used when the sprite is applied to a material.

int PowerUI.SPASprite.VerticalFrameCount

How many frames are down the height of the image.Sprite height/Frame height.

int PowerUI.SPASprite.Width

The width of the sprite.