JugiMap Framework
AnimationInstance Class Referenceabstract

The base animation instance class. More...

#include <jmAnimationCommon.h>

Inherited by DummyNoAnimationInstance, FrameAnimationInstance, and TimelineAnimationInstance.

Public Member Functions

AnimationKind GetKind ()
 Returns the kind of this animation. More...
 
virtual int Update (int msTimePoint, int _flags)=0
 Update the animation state for the given msTimePoint. More...
 
virtual void UpdateAnimatedSprites (bool _resetSpriteAnimatedProperties)=0
 Update the animated sprites. More...
 
AnimationGetAnimation ()
 Returns the animation object of this animation instance. More...
 
AnimationBaseParametersGetBaseParameters ()
 Returns the base animation parameters of this animation instance. More...
 
void SetCompleteLoops (bool _completeLoops)
 Set a parameter which indicates that the animation should finish its current loop before ending. More...
 
bool GetCompleteLoops ()
 Returns the completeLoops parameter of this animation instance. More...
 
void SetSpeedFactor (float _fSpeed)
 Set the speed factor of animation playback. The value 1.0 is the default speed; higher values means faster animation and lower values means slower animation. More...
 
float GetSpeedFactor ()
 Returns the speed factor of this animation instance. More...
 
void SetStartPlayTimeOffset (int _startPlayTimeOffset)
 Set the animation starting time point offset in milliseconds. More...
 
int GetStartPlayTimeOffset ()
 Returns the animation starting time point offset of this animation instance. More...
 

Detailed Description

The base animation instance class.

This class is used for playing animations in the animation players.

Member Function Documentation

◆ GetKind()

AnimationKind GetKind ( )
inline

Returns the kind of this animation.

◆ Update()

virtual int Update ( int  msTimePoint,
int  _flags 
)
pure virtual

Update the animation state for the given msTimePoint.

This function is usually called by animation players.

Implemented in DummyNoAnimationInstance, TimelineAnimationInstance, and FrameAnimationInstance.

◆ UpdateAnimatedSprites()

virtual void UpdateAnimatedSprites ( bool  _resetSpriteAnimatedProperties)
pure virtual

Update the animated sprites.

This function must be called manually when an animation player updates animation and returns PlayingAnimationFlags::ANIMATED_PROPERTIES_CHANGED flag. The parameter *_resetSpriteAnimatedProperties* must be set in the following way:

  • If one animation instance is used to animate a sprite the parameter is true.
  • If more animation instances (via more players) is used to animating the same sprite, the parameter is true for the first processed instance and false for the others.

Implemented in TimelineAnimationInstance, FrameAnimationInstance, and DummyNoAnimationInstance.

◆ GetAnimation()

Animation* GetAnimation ( )
inline

Returns the animation object of this animation instance.

◆ GetBaseParameters()

AnimationBaseParameters& GetBaseParameters ( )
inline

Returns the base animation parameters of this animation instance.

This is a copy of the parameters of the related animation object and can be changed before animation playback.

◆ SetCompleteLoops()

void SetCompleteLoops ( bool  _completeLoops)
inline

Set a parameter which indicates that the animation should finish its current loop before ending.

This parameter is used when the animation is played with an AnimationQueuePlayer object. If an AnimationPlayer object is used for playback it has no effect.

◆ GetCompleteLoops()

bool GetCompleteLoops ( )
inline

Returns the completeLoops parameter of this animation instance.

◆ SetSpeedFactor()

void SetSpeedFactor ( float  _fSpeed)
inline

Set the speed factor of animation playback. The value 1.0 is the default speed; higher values means faster animation and lower values means slower animation.

◆ GetSpeedFactor()

float GetSpeedFactor ( )
inline

Returns the speed factor of this animation instance.

◆ SetStartPlayTimeOffset()

void SetStartPlayTimeOffset ( int  _startPlayTimeOffset)
inline

Set the animation starting time point offset in milliseconds.

◆ GetStartPlayTimeOffset()

int GetStartPlayTimeOffset ( )
inline

Returns the animation starting time point offset of this animation instance.


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