JugiMap Framework
AnimationQueuePlayer Class Reference

The queue animation player for playing animations via animationInstance objects. More...

#include <jmAnimationCommon.h>

Public Member Functions

AnimationPlayerGetPlayer ()
 Returns the wrapped AnimationPlayer object. More...
 
AnimationInstanceGetAnimationInstance ()
 Returns the played animation instance. More...
 
int GetCurrentAnimationTime ()
 Returns the current animation time in milliseconds. More...
 
AnimationPlayerState GetState ()
 Returns the state of this player. More...
 
AKMeta * GetActiveMetaKey ()
 Returns the active meta key of the played animation or nullptr if none. More...
 
int Play (AnimationInstance *_animationInstance, int _flags=0)
 Play the given *_animationInstance*. More...
 
int Update ()
 Update the player. This command must be called in every update loop of the game logic. More...
 
void Pause ()
 Pause this player. More...
 
void Resume ()
 Resume this player. More...
 
int Stop ()
 Stop the played animation, clear the queue and put the player into the idle state. More...
 

Detailed Description

The queue animation player for playing animations via animationInstance objects.

The queue player can delay a new animation in order for the old animation to complete its loop. There can be up to five animations in queue; if there are more the oldest waiting will be removed. The behavior that an animation complete its loop before ending is set by AnimationInstance::SetCompleteLoops command. The goal of this behavior is to allow designing smooth transition beetwen animations. The AnimationQueuePlayer objects are used for playing sub-animations.

Member Function Documentation

◆ GetPlayer()

AnimationPlayer& GetPlayer ( )
inline

Returns the wrapped AnimationPlayer object.

◆ GetAnimationInstance()

AnimationInstance* GetAnimationInstance ( )
inline

Returns the played animation instance.

◆ GetCurrentAnimationTime()

int GetCurrentAnimationTime ( )
inline

Returns the current animation time in milliseconds.

◆ GetState()

AnimationPlayerState GetState ( )
inline

Returns the state of this player.

◆ GetActiveMetaKey()

AKMeta* GetActiveMetaKey ( )
inline

Returns the active meta key of the played animation or nullptr if none.

◆ Play()

int Play ( AnimationInstance _animationInstance,
int  _flags = 0 
)

Play the given *_animationInstance*.

The flag can be AnimationPlayerFlags::DISCARD_ANIMATION_QUEUE to stop and clear any waiting animations in queue.

◆ Update()

int Update ( )

Update the player. This command must be called in every update loop of the game logic.

◆ Pause()

void Pause ( )
inline

Pause this player.

◆ Resume()

void Resume ( )
inline

Resume this player.

◆ Stop()

int Stop ( )

Stop the played animation, clear the queue and put the player into the idle state.

To change the played animation there is no need to call this command. The Play command will stop any played animation before starting a new one.


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