LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
luactext.h
1 #ifndef LUACTEXT_H
2 #define LUACTEXT_H
3 
4 #include <string>
5 #include <memory>
6 #include <lua.hpp>
7 #include "luacudata.h"
8 #include "core/text.h"
9 
11 
15 namespace LuaC {
17  const std::string textMeta = "LPC.Text";
19  const std::string textClass = "Text";
21  template<>
22  const std::string UdataLib<std::shared_ptr<Text>>::mMetaTable = textMeta;
26  class TextLib : public UdataLib<std::shared_ptr<Text>> {
27  public:
29  static int luaopen_text(lua_State *l);
30 
31  private:
33  static const struct luaL_reg luaTextLib[];
35  static int newText(lua_State *l);
37  static int set(lua_State *l);
39  static int newIndex(lua_State *l);
41  static int setMessage(lua_State *l);
42  static int setFont(lua_State *l);
43  static int setSize(lua_State *l);
44  static int setColor(lua_State *l);
46  static int getMessage(lua_State *l);
47  static int getFont(lua_State *l);
48  static int getFontSize(lua_State *l);
49  static int getColor(lua_State *l);
51  static int size(lua_State *l);
53  static int width(lua_State *l);
55  static int height(lua_State *l);
57  static int release(lua_State *l);
59  static int garbageCollection(lua_State *l);
60  };
61 }
62 #endif