LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
button.h
1 #ifndef BUTTON_H
2 #define BUTTON_H
3 
4 #include <string>
5 #include "external/json/json.h"
6 #include "entity.h"
7 #include "image.h"
8 #include "text.h"
9 
11 
16 class Button : public Entity {
17 public:
18  Button();
23  Button(std::string script);
24  ~Button();
29  void Draw(std::weak_ptr<Camera> camera);
32  virtual void OnClick();
39  void RegisterCallBack(void (*f)(std::string), std::string param);
45  virtual Json::Value Save();
51  virtual void Load(Json::Value val);
52 
53 protected:
54  Text mText;
56  void (*mFunc)(std::string);
57  std::string mParam;
58 };
59 
60 #endif