Blame view

ios/Runner/Wowgame/Classes/game_toy/ToyAlertView.h 1.08 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
  //
  //  ToyAlertView.h
  //  HalloweenSpaceInvaders
  //
  //  Created by Katarzyna Kalinowska-Górska on 09/10/2019.
  //
  
  #ifndef ToyAlertView_h
  #define ToyAlertView_h
  
  #include "cocos2d.h"
  #include <string>
  
  class ToyAlertView : public cocos2d::LayerColor {
  public:
      static ToyAlertView* create(std::string message, std::string okText, std::string cancelText, cocos2d::Color3B okColor, cocos2d::Color3B cancelColor, std::function<void()> onConfirmCallback,std::function<void()> onCancelCallback);
  
  protected:
      
      std::function<void()> _onConfirmCallback;
      std::function<void()> _onCancelCallback;
      
      bool init(std::string message, std::string okText, std::string cancelText, cocos2d::Color3B okColor, cocos2d::Color3B cancelColor, std::function<void()> onConfirmCallback,std::function<void()> onCancelCallback);
      void setupAppearance(std::string message, std::string okText, std::string cancelText, cocos2d::Color3B okColor, cocos2d::Color3B cancelColor);
      
      void onCancelClicked(cocos2d::Ref* pSender);
      void onOKClicked(cocos2d::Ref* pSender);
  };
  
  #endif /* ToyAlertView_h */