WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. API
  4. Cubios::Gfx::AnimatedSprite
Mission NodeSDK 6.2C++gfx engine

Cubios::Gfx::AnimatedSprite

Cubios::Gfx::AnimatedSprite Public Enums playbackMode t Summary Sprite animation playback modes: Loop The animation is looped, when the last frame is reached...

API / SDK 6.2 / C++ / gfx engine

Cubios::Gfx::AnimatedSprite

Public Enums

playbackMode_t

Summary

Sprite animation playback modes:

  • Loop - The animation is looped, when the last frame is reached, it rewinds to the beginning
  • Bounce - The animation is looped, when the last frame is reached, the animation playback direction is reversed; when the first frame is reached, respectively, the direction of the animation playback changes again
  • Set - Animation plays 1 time beginning from the set frame

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1enum playbackMode_t
2{
3 Loop = 0,
4 Bounce,
5 Set
6};
7
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Constructors

AnimatedSprite

Constructs an object for rendering articulated set of images, an animated sprite

Arguments

  • names - names of sprite resources, each represents a single frame of animation
  • t - Transform object that holds initial screen position, rotation and mirroring mode of the sprite

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1AnimatedSprite(std::vector<std::string>& names, const Cubios::Math::Transform& t)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • names - names of sprite resources, each represents a single frame of animation
  • x - x screen coordinate of initial postion of the sprite
  • y - y screen coordinate of initial postion of the sprite

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1AnimatedSprite(std::vector<std::string>& names, float x, float y)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • names - names of sprite resources, each represents a single frame of animation

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1AnimatedSprite(std::vector<std::string>& names)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • name - a "common" name of sprite resources
  • extension - filename extension of sprite resources
  • firstFrame - index of the first frame of animation
  • lastFrame - index of the last frame of animation
  • t - Transform object that holds initial screen position, rotation and mirroring mode of the sprite

Comment

Consider the following set of files that holds animation frames:

Cubios::Gfx::AnimatedSprite
CPP
1anim1.png
2anim2.png
3anim3.png
4anim4.png
5anim5.png
6
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

In order to create an animation that plays all frames in 1-2-3-4-5 order, the name should be anim, the extension is png and the first and last values are 1 and 5 correspondingly

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1AnimatedSprite(std::string name,std::string extension, int16_t firstFrame, int16_t lastFrame, const Cubios::Math::Transform& t)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • name - a "common" name of sprite resources
  • extension - filename extension of sprite resources
  • firstFrame - index of the first frame of animation
  • lastFrame - index of the last frame of animation
  • x - x screen coordinate of initial postion of the sprite
  • y - y screen coordinate of initial postion of the sprite

Comment

Consider the following set of files that holds animation frames:

Cubios::Gfx::AnimatedSprite
CPP
1anim1.png
2anim2.png
3anim3.png
4anim4.png
5anim5.png
6
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

In order to create an animation that plays all frames in 1-2-3-4-5 order, the name should be anim, the extension is png and the first and last values are 1 and 5 correspondingly

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1AnimatedSprite(std::string name,std::string extension, int16_t firstFrame, int16_t lastFrame, float x, float y)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • name - a "common" name of sprite resources
  • extension - filename extension of sprite resources
  • firstFrame - index of the first frame of animation
  • lastFrame - index of the last frame of animation

Comment

Consider the following set of files that holds animation frames:

Cubios::Gfx::AnimatedSprite
CPP
1anim1.png
2anim2.png
3anim3.png
4anim4.png
5anim5.png
6
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

In order to create an animation that plays all frames in 1-2-3-4-5 order, the name should be anim, the extension is png and the first and last values are 1 and 5 correspondingly

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1AnimatedSprite(std::string name,std::string extension, int16_t firstFrame, int16_t lastFrame)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • sprite - animated sprite object which parameters will be used to initialize the sprite

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1AnimatedSprite(const AnimatedSprite& sprite)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Public Methods

Tick

Summary

Executes animation step. Must be called before the sprite is rendered

Arguments

  • dt - time since previous call of the function, in milliseconds

Output

Returns an index of current frame of the animation

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1int16_t Tick(uint32_t dt)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

SetFrame

Summary

Sets current frame of the animation

Arguments

  • frameNumber - index of a frame

Output

Returns a pointer to the object to which the change was applied

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1Cubios::SceneObject* SetFrame(int16_t frameNumber)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

SetPlaybackSpeed

Summary

Sets animation playback speed, the time that must pass between frames of the animation before current frame gets changed to the next one

Arguments

  • speed - playback speed, in milliseconds

Output

Returns a pointer to the object to which the change was applied

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1Cubios::SceneObject* SetPlaybackSpeed(int16_t speed)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

SetPlaybackMode

Summary

Sets animation playback mode. Available modes are loop, bounce and set

Arguments

  • mode - animation playback mode

Output

Returns a pointer to the object to which the change was applied

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1Cubios::SceneObject* SetPlaybackMode(playbackMode_t mode)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PrevFrame

Summary

Gets an index of previous frame in the animation relatively to current one

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1int16_t PrevFrame()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

NextFrame

Summary

Gets an index of previous frame in the animation relatively to current one

Synopsis

Cubios::Gfx::AnimatedSprite
CPP
1int16_t NextFrame()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Jump Grid

On This Page

Public EnumsplaybackMode tConstructorsAnimatedSpritePublic MethodsTickSetFrameSetPlaybackSpeedSetPlaybackModePrevFrameNextFrame
Context Rail

Related nodes

Cubios::Math
API / SDK 6.2 / C++ / gfx engine
Cubios::Math::Vec2
API / SDK 6.2 / C++ / gfx engine
Cubios::Math::Transform
API / SDK 6.2 / C++ / gfx engine
Cubios::Math::Color
API / SDK 6.2 / C++ / gfx engine
Previous Node
Cubios::Gfx::Sprite
API / SDK 6.2 / C++ / gfx engine
Next Node
Cubios::Gfx::Text
API / SDK 6.2 / C++ / gfx engine