-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSuperAnimNode.h
95 lines (67 loc) · 2.05 KB
/
SuperAnimNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* sumator.h */
#ifndef SUPER_ANIM_NODE_H
#define SUPER_ANIM_NODE_H
#include "scene/2d/node_2d.h"
#include "SuperAnimResource.h"
#include "SuperAnimSprite.h"
class SuperAnimNode : public Node2D, public SuperAnim::SuperAnimHandler {
OBJ_TYPE(SuperAnimNode, Node2D);
int count;
Color myColor;
int mId;
bool mIsFlipX;
bool mIsFlipY;
float mSpeedFactor;
bool mIsLoop;
AnimState mAnimState;
//sprite replacement
SuperAnim::IdToSuperAnimSpriteMap mReplacedSpriteMap;
//properties to show.
bool showStage;
bool showAxis;
Ref<SuperAnimData> mSamRes;
StringArray mSections;
Vector<Point2> p_points;
Vector<Point2> p_uvs;
void superAnimDraw();
void superAnimUpdate(float dt);
protected:
static void _bind_methods();
public:
bool PlaySection(const String &labelName, bool isLoop = false);
bool HasSection(const String &labelName);
void setSpeedFactor(float newSpeedFactor);
void Pause();
void Resume();
bool IsPause();
bool IsPlaying();
int GetCurFrame();
int GetId();
//set the section that is played now.
String GetCurSectionName();
void SetCurSectionName(String section);
float get_width();
float get_height();
void set_flipx(bool value);
bool is_flipx();
void set_flipy(bool value);
bool is_flipy();
void set_loop(bool value);
bool is_loop();
void set_showstage(bool p_ShowStage);
bool is_showstage() const;
void set_showaxis(bool p_ShowAxis);
bool is_showaxis() const;
void set_animspeed(float value);
float get_animspeed();
void set_sam(const Ref<SuperAnimData>);
Ref<SuperAnimData> get_sam() const;
void replace_sprite(const String originalSpriteName, const String newSpriteName);
void resume_sprite(const String originalSpriteName);
//load the resource string and get the corresponding handle.
void load_anim(String resPath);
//function for handling callbacks for engine events.
void _notification(int p_what);
SuperAnimNode();
};
#endif