JugiMap Framework
|
A class for using frame animations in animation players. More...
#include <jmFrameAnimation.h>
Inherits AnimationInstance.
Public Member Functions | |
FrameAnimationInstance (FrameAnimation *_animation, Sprite *_sprite) | |
Constructor. More... | |
FrameAnimationInstance (FrameAnimation *_animation, std::vector< Sprite * > &_sprites) | |
Constructor. More... | |
~FrameAnimationInstance () override | |
Destructor. More... | |
Sprite * | GetSprite () |
Returns the assigned sprite; if a vector of sprites has been assigned it returns nullptr! More... | |
std::vector< Sprite * > * | GetSprites () |
Returns a pointer to the vector of assigned sprites; if one sprite has been assigned it returns nullptr. More... | |
int | GetStartingFrameIndex () |
Returns the starting index in the sequence of frames of this animation. More... | |
void | SetStartingFrameIndex (int _startingFrameIndex) |
Set the starting index in the sequence of frames of this animation to the given *_startingFrameIndex*. More... | |
AnimatedProperties & | GetAnimatedProperties () |
Get a reference to the AnimatedProperties object of this animation instance. More... | |
int | Update (int msTimePoint, int _flags) override |
Update the animation state for the given msTimePoint. More... | |
void | UpdateAnimatedSprites (bool _resetSpriteAnimatedProperties) override |
Update the animated sprites. More... | |
![]() | |
AnimationKind | GetKind () |
Returns the kind of this animation. More... | |
Animation * | GetAnimation () |
Returns the animation object of this animation instance. More... | |
AnimationBaseParameters & | GetBaseParameters () |
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... | |
A class for using frame animations in animation players.
FrameAnimationInstance | ( | FrameAnimation * | _animation, |
Sprite * | _sprite | ||
) |
Constructor.
Create an FrameAnimationInstance object for animating the given sprite *_sprite* with the given frame animation *_animation*.
FrameAnimationInstance | ( | FrameAnimation * | _animation, |
std::vector< Sprite * > & | _sprites | ||
) |
Constructor.
Create an FrameAnimationInstance object for animating the given sprites *_sprites* with the given frame animation *_animation*. The sprites must have the same SourceSprite!
|
override |
Destructor.
|
inline |
Returns the assigned sprite; if a vector of sprites has been assigned it returns nullptr!
|
inline |
Returns a pointer to the vector of assigned sprites; if one sprite has been assigned it returns nullptr.
The vector of assigned sprites object is owned by FrameAnimationInstance object! Sprites themselves are link pointers.
|
inline |
Returns the starting index in the sequence of frames of this animation.
void SetStartingFrameIndex | ( | int | _startingFrameIndex | ) |
Set the starting index in the sequence of frames of this animation to the given *_startingFrameIndex*.
|
inline |
Get a reference to the AnimatedProperties object of this animation instance.
|
overridevirtual |
Update the animation state for the given msTimePoint.
This function is usually called by animation players.
Implements AnimationInstance.
|
overridevirtual |
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:
Implements AnimationInstance.