9 #ifndef _TurtleBrains_AnimatedSprite_h_
10 #define _TurtleBrains_AnimatedSprite_h_
12 #include "tb_sprite.h"
13 #include "tb_sprite_map.h"
111 std::vector<SpriteFrame> mAnimationFrames;
146 const PixelSpace& frameWidth = 0,
const PixelSpace& frameHeight = 0,
const size_t& frameCount = 1);
218 const size_t& frameCount);
237 const float timePerFrame = kDefaultTimePerFrame);
286 virtual void OnUpdate(
const float deltaTime)
override;
289 typedef std::map<tbCore::tbString, AnimationSequence> AnimationContainer;
290 AnimationContainer mAnimationSequences;
293 size_t mCurrentFrameIndex;
static void SetAnimationFrameRate(const int framesPerSecond)
void AddMappedSequence(const tbCore::tbString &sequenceName, const SpriteMap &spriteMap, const std::vector< size_t > frames)
AnimatedSprite(const SpriteFrame &spriteFrame)
Give the GameScene and Entities something to display, Text, Sprites and AnimatedSprites help bring th...
virtual void OnUpdate(const float deltaTime) override
Definition: tb_sprite.h:29
void PlayAnimation(const tbCore::tbString &sequenceName, const bool isLooping, const bool isForward=true, const float timePerFrame=kDefaultTimePerFrame)
Here is some information about the primary namespace.
Definition: tb_application_dialog.h:21
virtual ~AnimatedSprite(void)
Definition: tb_animated_sprite.h:29
static const float & kDefaultTimePerFrame
Definition: tb_animated_sprite.h:129
tbCore::uint32 TextureHandle
Definition: tb_texture_manager.h:43
tbCore::uint16 PixelSpace
Definition: tb_texture_manager.h:35
Definition: tb_sprite_map.h:23
void AddFrame(const SpriteFrame &frame)
AnimationSequence(const TextureHandle &textureHandle)
size_t GetFrameCount(void) const
AnimatedSprite & operator=(const AnimatedSprite &other)
const SpriteFrame & GetFrame(const size_t &frameIndex) const
std::string tbString
Definition: tb_string.h:335
void AddSequence(const tbCore::tbString &sequenceName, const AnimationSequence &sequence)
Definition: tb_animated_sprite.h:119
bool IsAnimationPlaying(void) const
Definition: tb_sprite.h:136
size_t GetFrameIndex(void) const
Definition: tb_animated_sprite.h:278