This class represents a sprite sequence animation, that is, a sequence of sprite frames to play over time.
#include <scenetree/YiSpriteSceneNode.h>
Public Member Functions | |
| SpriteAnimation (SpriteSheet *pSpriteSheet, std::vector< uint32_t > &frameSequence, uint32_t uFPS, uint32_t uLoops) | |
| ~SpriteAnimation () | |
| uint32_t | GetSequenceIndexAtPercentage (float fPercentage) const |
| void | UpdateSpriteFrame (uint32_t uSequenceIndex) const |
| void | SetIndex (uint32_t uIndex) |
| uint32_t | GetIndex () const |
| SpriteSheet * | GetSpriteSheet () const |
| const std::vector< uint32_t > & | GetFrameSequence () const |
| uint32_t | GetFPS () const |
| uint32_t | GetLoops () const |
| CYISpriteSceneNode::SpriteAnimation::SpriteAnimation | ( | SpriteSheet * | pSpriteSheet, |
| std::vector< uint32_t > & | frameSequence, | ||
| uint32_t | uFPS, | ||
| uint32_t | uLoops | ||
| ) |
Frames are provided in the array frameSequence. uFPS is the target framerate of the animation, and uLoops is the number of times the animation should play.
| CYISpriteSceneNode::SpriteAnimation::~SpriteAnimation | ( | ) |
| uint32_t CYISpriteSceneNode::SpriteAnimation::GetFPS | ( | ) | const |
| const std::vector<uint32_t>& CYISpriteSceneNode::SpriteAnimation::GetFrameSequence | ( | ) | const |
| uint32_t CYISpriteSceneNode::SpriteAnimation::GetIndex | ( | ) | const |
| uint32_t CYISpriteSceneNode::SpriteAnimation::GetLoops | ( | ) | const |
| uint32_t CYISpriteSceneNode::SpriteAnimation::GetSequenceIndexAtPercentage | ( | float | fPercentage | ) | const |
For any given normalized time between 0-1, what frame sequence index should be played. Note that this is not the sprite sheet frame index, but rather the index of the m_frameSequence
| SpriteSheet* CYISpriteSceneNode::SpriteAnimation::GetSpriteSheet | ( | ) | const |
| void CYISpriteSceneNode::SpriteAnimation::SetIndex | ( | uint32_t | uIndex | ) |
| void CYISpriteSceneNode::SpriteAnimation::UpdateSpriteFrame | ( | uint32_t | uSequenceIndex | ) | const |
Set the animation's sprite sheet to draw the current sequence frame