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. Source
  4. AnimatedSprite.h
Mission NodeSDK 6.1C++gfx

AnimatedSprite.h

SDK Source File: AnimatedSprite.h

Source / SDK 6.1 / C++ / gfx

AnimatedSprite.h

AnimatedSprite.h
CPP
1/* Copyright Statement:
2 *
3 * (C) 2021-2024 Cubios Inc. All rights reserved.
4 */
5#pragma once
6#include "SceneObject.h"
7#include <string>
8#include <vector>
9
10namespace Cubios
11{
12namespace Gfx
13{
14class AnimatedSprite: public Cubios::SceneObject
15{
16 public:
17
18 enum playbackMode_t
19 {
20 Loop = 0,
21 Bounce,
22 Set
23 };
24
25 AnimatedSprite(std::vector<std::string>& names, const Cubios::Math::Transform& t);
26 AnimatedSprite(std::vector<std::string>& names, float x, float y);
27 AnimatedSprite(std::vector<std::string>& names);
28
29 AnimatedSprite(std::string name,std::string extension, int16_t firstFrame, int16_t lastFrame, const Cubios::Math::Transform& t);
30 AnimatedSprite(std::string name,std::string extension, int16_t firstFrame, int16_t lastFrame, float x, float y);
31 AnimatedSprite(std::string name,std::string extension, int16_t firstFrame, int16_t lastFrame);
32
33 AnimatedSprite(const AnimatedSprite& sprite);
34
35 virtual ~AnimatedSprite();
36 void Render() override;
37
38 int16_t Tick(uint32_t dt);
39
40 Cubios::SceneObject* SetFrame(int16_t frameNumber);
41 Cubios::SceneObject* SetPlaybackSpeed(int16_t speed);
42 Cubios::SceneObject* SetPlaybackMode(playbackMode_t mode);
43
44 int16_t PrevFrame();
45 int16_t NextFrame();
46
47 protected:
48
49 virtual void doLoop(uint32_t dt);
50 virtual void doBounce(uint32_t dt);
51 virtual void doSet(uint32_t dt) {}
52
53 int16_t playbackSpeed;
54 int16_t numFrames;
55 int16_t startFrame;
56 int32_t prevTime;
57 uint32_t lastDt;
58
59 std::vector<u32_t> resourceIds;
60
61 playbackMode_t playbackMode;
62 bool reverse;
63
64 int16_t currentFrame;
65};
66}
67}
68
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.
Context Rail

Related nodes

AnimatedSprite.cpp
Source / SDK 6.1 / C++ / gfx
Background.cpp
Source / SDK 6.1 / C++ / gfx
Background.h
Source / SDK 6.1 / C++ / gfx
Colors.h
Source / SDK 6.1 / C++ / gfx
Previous Node
AnimatedSprite.cpp
Source / SDK 6.1 / C++ / gfx
Next Node
Background.cpp
Source / SDK 6.1 / C++ / gfx