Blame view

ios/Runner/Wowgame/Classes/game_halloween/HLayoutObject.h 1.58 KB
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
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
  //
  //  HLayoutObject.h
  //  SteveMaggieCpp
  //
  //  Created by Katarzyna Kalinowska-Górska on 16.05.2017.
  //
  //
  
  #ifndef HLayoutObject_h
  #define HLayoutObject_h
  
  #include "json/document.h"
  #include "ui/CocosGUI.h"
  #include "cocos2d.h"
  
  class HLayoutViewInterface;
  
  class HLayoutObject
  {
      public:
      
          std::string className;
          std::string objectName;
      
          virtual ~HLayoutObject();
      
          virtual void loadPropertiesFromJSON(const rapidjson::Value& jsonValue, HLayoutViewInterface* scene = NULL, const std::string resFolder = "", const std::string altResFolder = "") = 0;
      
          virtual void loadCommonPropertiesFromJSON(const rapidjson::Value& jsonValue, HLayoutViewInterface* scene = NULL, const std::string resFolder = "", const std::string altResFolder = "");
      
          virtual void prepareSize(const rapidjson::Value& jsonValue, float& width, float& height);
      
          virtual bool isWidget()
          {
              return false;
          };
      
          // for widgets
      
          virtual void setOnTouchBeganCallback(std::function<void(std::string, cocos2d::ui::Widget::TouchEventType)> callback){};
          virtual void setOnTouchEndedCallback(std::function<void(std::string, cocos2d::ui::Widget::TouchEventType)> callback){};
          virtual void setOnTouchCancelledCallback(std::function<void(std::string, cocos2d::ui::Widget::TouchEventType)> callback){};
  
          virtual std::string getObjectName(){
              return objectName;
          };
  
          virtual std::string getClassName(){
              return className;
          };
  };
  
  #endif /* HLayoutObject_h */