-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathScriptManager.h
More file actions
97 lines (78 loc) · 2.75 KB
/
ScriptManager.h
File metadata and controls
97 lines (78 loc) · 2.75 KB
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
96
97
#ifndef CLASS_SCRIPTMANAGER
#define CLASS_SCRIPTMANAGER
#include <nctl/Array.h>
struct lua_State;
class Sprite;
class Script;
namespace nc = ncine;
/// The class that handles Lua scripts
class ScriptManager
{
public:
ScriptManager() {}
inline nctl::Array<nctl::UniquePtr<Script>> &scripts() { return scripts_; }
inline const nctl::Array<nctl::UniquePtr<Script>> &scripts() const { return scripts_; }
void clear();
int scriptIndex(const Script *script) const;
static void pushSprite(lua_State *L, Sprite *sprite);
private:
nctl::Array<nctl::UniquePtr<Script>> scripts_;
static Sprite *retrieveSprite(lua_State *L);
static void exposeConstants(lua_State *L);
static void exposeFunctions(lua_State *L);
static int canvasWidth(lua_State *L);
static int canvasHeight(lua_State *L);
static int textureWidth(lua_State *L);
static int textureHeight(lua_State *L);
static int width(lua_State *L);
static int height(lua_State *L);
static int position(lua_State *L);
static int positionX(lua_State *L);
static int positionY(lua_State *L);
static int rotation(lua_State *L);
static int scale(lua_State *L);
static int scaleX(lua_State *L);
static int scaleY(lua_State *L);
static int anchorPoint(lua_State *L);
static int anchorPointX(lua_State *L);
static int anchorPointY(lua_State *L);
static int color(lua_State *L);
static int texRect(lua_State *L);
static int isFlippedX(lua_State *L);
static int isFlippedY(lua_State *L);
static int rgbBlendingPreset(lua_State *L);
static int alphaBlendingPreset(lua_State *L);
static int numVertices(lua_State *L);
static int vertices(lua_State *L);
static int verticesXY(lua_State *L);
static int verticesUV(lua_State *L);
static int verticesX(lua_State *L);
static int verticesY(lua_State *L);
static int verticesU(lua_State *L);
static int verticesV(lua_State *L);
static int setPosition(lua_State *L);
static int setPositionX(lua_State *L);
static int setPositionY(lua_State *L);
static int setRotation(lua_State *L);
static int setScale(lua_State *L);
static int setScaleX(lua_State *L);
static int setScaleY(lua_State *L);
static int setAnchorPoint(lua_State *L);
static int setAnchorPointX(lua_State *L);
static int setAnchorPointY(lua_State *L);
static int setColor(lua_State *L);
static int setTexRect(lua_State *L);
static int setFlippedX(lua_State *L);
static int setFlippedY(lua_State *L);
static int setRgbBlendingPreset(lua_State *L);
static int setAlphaBlendingPreset(lua_State *L);
static int setVertices(lua_State *L);
static int setVerticesXY(lua_State *L);
static int setVerticesUV(lua_State *L);
static int setVerticesX(lua_State *L);
static int setVerticesY(lua_State *L);
static int setVerticesU(lua_State *L);
static int setVerticesV(lua_State *L);
friend class Script;
};
#endif