SpriteManager 2
 All Classes Functions Variables Enumerations Enumerator Properties
UVAnimation_Multi Class Reference

Public Member Functions

UVAnimation_Auto GetCurrentClip ()
 Gets a reference to the currently-playing clip. More...
 
UVAnimation_Auto[] BuildUVAnim (SpriteRoot s)
 Builds the UV animations for all animation clips that are a part of this animation sequence. More...
 
SPRITE_FRAME GetCurrentFrame ()
 Returns the SPRITE_FRAME of the current frame without advancing to the next frame. More...
 
void AppendAnim (int index, SPRITE_FRAME[] anim)
 Appends UV animation to the clip specified by index. More...
 
void AppendClip (UVAnimation clip)
 Appends UV animation clip to the end of the animation sequence. More...
 
void SetAnim (int index, SPRITE_FRAME[] frames)
 Replaces the contents of the specified clip. More...
 
void Reset ()
 Resets the animation sequence for playing anew. More...
 
void SetPosition (float pos)
 Sets the current playing position of the animation. NOTE: This method takes loop cycles and loop reversing into account. To set the position without regard to loop cycles or loop reversing, use SetAnimPosition(). More...
 
void SetAnimPosition (float pos)
 Sets the current playing position of the animation. NOTE: This method does NOT take loop cycles and loop reversing into account. To set the position taking loop cycles and loop reversing into account, use SetPosition(). More...
 
float GetDuration ()
 Returns the duration, in seconds, of the animation. NOTE: This takes into account loop cycles and loop reverse. Ex: If an animation has a framerate of 30fps, consists of 60 frames, and is set to loop once, the duration will be 4 seconds. More...
 
int GetFrameCount ()
 Returns the total number of frames displayed by this animation. More...
 
int GetCurPosition ()
 Returns the (zero-based) frame number of the current position in the over all animation. Example: If the multi contains a total of 100 frames and 25 frames have played so far, then 24 will be returned (because it is zero-based). If the multi is playing backwards, this number will count down from 100 as well. More...
 
int GetCurClipNum ()
 Returns the (zero-based) index of the current clip. More...
 
void SetCurClipNum (int index)
 Sets the current clip by index. More...
 

Public Attributes

string name
 The name of the animation sequence More...
 
int loopCycles = 0
 How many times to loop the animation IN ADDITION TO the initial play-through. (-1 to loop infinitely, 0 not to loop at all, 1 to repeat once before stopping, etc.) More...
 
bool loopReverse = false
 Reverse the play direction when the end of the animation is reached? If true, a loop iteration isn't counted until the animation returns to the beginning. More...
 
float framerate = 15f
 The rate in frames per second at which to play the animation. More...
 
UVAnimation.ANIM_END_ACTION onAnimEnd = UVAnimation.ANIM_END_ACTION.Do_Nothing
 What the sprite should do when the animation is done playing. The options are to: 1) Do nothing, 2) return to the static image, 3) play the default animation. More...
 
UVAnimation_Auto[] clips
 The actual sprite animation clips that make up the animation sequence. More...
 

Properties

int StepDirection [get, set]
 The direction in which the animation is currently set to advance. 1 for forwards, -1 for backwards. More...
 

Detailed Description

This class allows you to specify multiple animation "clips" that will play sequentially to the end of the list of clips.

Definition at line 697 of file SpriteBase.cs.

Member Function Documentation

void UVAnimation_Multi.AppendAnim ( int  index,
SPRITE_FRAME[]  anim 
)

Appends UV animation to the clip specified by index.

Parameters
indexThe animation clip to append to.
animArray of ANIM_FRAMEs that define the animation to be appended.

Definition at line 942 of file SpriteBase.cs.

void UVAnimation_Multi.AppendClip ( UVAnimation  clip)

Appends UV animation clip to the end of the animation sequence.

Parameters
clipAnimation clip to append.

Definition at line 956 of file SpriteBase.cs.

UVAnimation_Auto [] UVAnimation_Multi.BuildUVAnim ( SpriteRoot  s)

Builds the UV animations for all animation clips that are a part of this animation sequence.

Parameters
sThe sprite for which to build the animation.
Returns
Array of animation clips that constitute the animation sequence.

Definition at line 806 of file SpriteBase.cs.

int UVAnimation_Multi.GetCurClipNum ( )

Returns the (zero-based) index of the current clip.

Returns
The (zero-based) index of the current clip.

Definition at line 1233 of file SpriteBase.cs.

int UVAnimation_Multi.GetCurPosition ( )

Returns the (zero-based) frame number of the current position in the over all animation. Example: If the multi contains a total of 100 frames and 25 frames have played so far, then 24 will be returned (because it is zero-based). If the multi is playing backwards, this number will count down from 100 as well.

Returns
Zero-based frame number of the current position in the over all animation.

Definition at line 1224 of file SpriteBase.cs.

UVAnimation_Auto UVAnimation_Multi.GetCurrentClip ( )

Gets a reference to the currently-playing clip.

Returns
Reference to the currently-playing clip.

Definition at line 785 of file SpriteBase.cs.

SPRITE_FRAME UVAnimation_Multi.GetCurrentFrame ( )

Returns the SPRITE_FRAME of the current frame without advancing to the next frame.

Returns
An SPRITE_FRAME containing the UV coordinates of the current frame.

Definition at line 931 of file SpriteBase.cs.

float UVAnimation_Multi.GetDuration ( )

Returns the duration, in seconds, of the animation. NOTE: This takes into account loop cycles and loop reverse. Ex: If an animation has a framerate of 30fps, consists of 60 frames, and is set to loop once, the duration will be 4 seconds.

Returns
The duration of the animation in seconds. -1 if the animation loops infinitely.

Definition at line 1194 of file SpriteBase.cs.

int UVAnimation_Multi.GetFrameCount ( )

Returns the total number of frames displayed by this animation.

Returns
Number of frames to be displayed.

Definition at line 1204 of file SpriteBase.cs.

void UVAnimation_Multi.Reset ( )

Resets the animation sequence for playing anew.

Definition at line 999 of file SpriteBase.cs.

void UVAnimation_Multi.SetAnim ( int  index,
SPRITE_FRAME[]  frames 
)

Replaces the contents of the specified clip.

Parameters
indexIndex of the clip the contents of which you wish to replace.
framesArray of ANIM_FRAMEs that define the content of an animation clip.

Definition at line 986 of file SpriteBase.cs.

void UVAnimation_Multi.SetAnimPosition ( float  pos)

Sets the current playing position of the animation. NOTE: This method does NOT take loop cycles and loop reversing into account. To set the position taking loop cycles and loop reversing into account, use SetPosition().

Parameters
posDesired position in the animation (0-1).

Definition at line 1054 of file SpriteBase.cs.

void UVAnimation_Multi.SetCurClipNum ( int  index)

Sets the current clip by index.

Parameters
indexThe zero-based index of the clip.

Definition at line 1242 of file SpriteBase.cs.

void UVAnimation_Multi.SetPosition ( float  pos)

Sets the current playing position of the animation. NOTE: This method takes loop cycles and loop reversing into account. To set the position without regard to loop cycles or loop reversing, use SetAnimPosition().

Parameters
posDesired position in the animation (0-1).

Definition at line 1019 of file SpriteBase.cs.

Member Data Documentation

UVAnimation_Auto [] UVAnimation_Multi.clips

The actual sprite animation clips that make up the animation sequence.

Definition at line 729 of file SpriteBase.cs.

float UVAnimation_Multi.framerate = 15f

The rate in frames per second at which to play the animation.

Definition at line 717 of file SpriteBase.cs.

int UVAnimation_Multi.loopCycles = 0

How many times to loop the animation IN ADDITION TO the initial play-through. (-1 to loop infinitely, 0 not to loop at all, 1 to repeat once before stopping, etc.)

Definition at line 707 of file SpriteBase.cs.

bool UVAnimation_Multi.loopReverse = false

Reverse the play direction when the end of the animation is reached? If true, a loop iteration isn't counted until the animation returns to the beginning.

Definition at line 712 of file SpriteBase.cs.

string UVAnimation_Multi.name

The name of the animation sequence

Definition at line 702 of file SpriteBase.cs.

UVAnimation.ANIM_END_ACTION UVAnimation_Multi.onAnimEnd = UVAnimation.ANIM_END_ACTION.Do_Nothing

What the sprite should do when the animation is done playing. The options are to: 1) Do nothing, 2) return to the static image, 3) play the default animation.

Definition at line 724 of file SpriteBase.cs.

Property Documentation

int UVAnimation_Multi.StepDirection
getset

The direction in which the animation is currently set to advance. 1 for forwards, -1 for backwards.

Definition at line 795 of file SpriteBase.cs.


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