NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UISpriteAnimation Class Reference

Very simple sprite animation. Attach to a sprite and specify a common prefix such as "idle" and it will cycle through them. More...

Inheritance diagram for UISpriteAnimation:

Public Member Functions

void RebuildSpriteList ()
 Rebuild the sprite list after changing the sprite name. More...
 
void Play ()
 Reset the animation to the beginning. More...
 
void Pause ()
 Pause the animation. More...
 
void ResetToBeginning ()
 Reset the animation to frame 0 and activate it. More...
 

Protected Member Functions

virtual void Start ()
 Rebuild the sprite list first thing. More...
 
virtual void Update ()
 Advance the sprite animation process. More...
 

Protected Attributes

int mFPS = 30
 
string mPrefix = ""
 
bool mLoop = true
 
bool mSnap = true
 
UISprite mSprite
 
float mDelta = 0f
 
int mIndex = 0
 
bool mActive = true
 
List< string > mSpriteNames = new List<string>()
 

Properties

int frames [get]
 Number of frames in the animation. More...
 
int framesPerSecond [get, set]
 Animation framerate. More...
 
string namePrefix [get, set]
 Set the name prefix used to filter sprites from the atlas. More...
 
bool loop [get, set]
 Set the animation to be looping or not More...
 
bool isPlaying [get]
 Returns is the animation is still playing or not More...
 

Detailed Description

Very simple sprite animation. Attach to a sprite and specify a common prefix such as "idle" and it will cycle through them.

Member Function Documentation

void UISpriteAnimation.Pause ( )

Pause the animation.

void UISpriteAnimation.Play ( )

Reset the animation to the beginning.

void UISpriteAnimation.RebuildSpriteList ( )

Rebuild the sprite list after changing the sprite name.

void UISpriteAnimation.ResetToBeginning ( )

Reset the animation to frame 0 and activate it.

virtual void UISpriteAnimation.Start ( )
protectedvirtual

Rebuild the sprite list first thing.

virtual void UISpriteAnimation.Update ( )
protectedvirtual

Advance the sprite animation process.

Member Data Documentation

bool UISpriteAnimation.mActive = true
protected
float UISpriteAnimation.mDelta = 0f
protected
int UISpriteAnimation.mFPS = 30
protected
int UISpriteAnimation.mIndex = 0
protected
bool UISpriteAnimation.mLoop = true
protected
string UISpriteAnimation.mPrefix = ""
protected
bool UISpriteAnimation.mSnap = true
protected
UISprite UISpriteAnimation.mSprite
protected
List<string> UISpriteAnimation.mSpriteNames = new List<string>()
protected

Property Documentation

int UISpriteAnimation.frames
get

Number of frames in the animation.

int UISpriteAnimation.framesPerSecond
getset

Animation framerate.

bool UISpriteAnimation.isPlaying
get

Returns is the animation is still playing or not

bool UISpriteAnimation.loop
getset

Set the animation to be looping or not

string UISpriteAnimation.namePrefix
getset

Set the name prefix used to filter sprites from the atlas.


The documentation for this class was generated from the following file: