Blame view

ios/Runner/Wowgame/Classes/game_food/LevelView.h 1.17 KB
cb213901   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
  //
  //  LevelView.h
  //  HalloweenSpaceInvaders
  //
  //  Created by Katarzyna Kalinowska-Górska on 27/09/2019.
  //
  
  #ifndef LevelView_h
  #define LevelView_h
  
  #include "cocos2d.h"
  #include <string>
  #include "LayoutObject.h"
  
  class LevelView : public cocos2d::Node, public LayoutObject {
  
  public:
      static LevelView* create(std::string levelImagePath);
      static LevelView* create(std::string levelImagePath, std::string levelName);
      void setChosen(bool chosen, bool animated = true);
      void changePicture(std::string newPicturePath);
      
      virtual void loadPropertiesFromJSON(const rapidjson::Value& jsonValue, LayoutViewInterface* scene = NULL, const std::string resFolder = "", const std::string altResFolder = "") override;
      
      void startFloating();
      void stopFloating();
      virtual void doFloat(bool start = false);
      void flash();
      
  protected:
      bool _isChosen;
      bool _isFloating;
      int _floatDirection;
      cocos2d::Point _circleMidPoint;
      cocos2d::Sprite* _bgNode;
      cocos2d::Sprite* _pic;
      cocos2d::Label* _label;
      
      bool init(std::string levelImagePath);
      bool init(std::string levelImagePath, std::string levelName);
  };
  
  
  #endif /* LevelView_h */