Blame view

ios/Runner/Wowgame/Classes/game_food/TouchInterceptingLayer.h 1.31 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
  //
  //  TouchInterceptingLayer.hpp
  //  SteveMaggieCpp
  //
  //  Created by Katarzyna Kalinowska-Górska on 12.05.2017.
  //
  //
  
  #ifndef TouchInterceptingLayer_h
  #define TouchInterceptingLayer_h
  
  #include <stdio.h>
  #include "cocos2d.h"
  
  class TouchInterceptingLayer : public cocos2d::LayerColor {
  
      public:
      
          static const int TouchEventListenerPriority = -100;
      
          // create
          static TouchInterceptingLayer * create(const cocos2d::Color4B& color, bool sceneGraphPriority = true);
  
          // init
          virtual bool initWithColor(const cocos2d::Color4B& color, bool sceneGraphPriority = true);
          virtual void configureTouchListener(bool sceneGraphPriority = true);
      
          // setters
          virtual void setOnTouchCallback(const std::function<void(cocos2d::Touch*)>& onTouchCallback);
          virtual void setOnTouchMovedCallback(const std::function<void(cocos2d::Touch*)>& onTouchCallback);
          virtual void setOnTouchEndedCallback(const std::function<void(cocos2d::Touch*)>& onTouchCallback);
          virtual void clearTouchHandlers();
  
      protected:
      
          std::function<void(cocos2d::Touch*)> _onTouchCallback;
          std::function<void(cocos2d::Touch*)> _onTouchMovedCallback;
          std::function<void(cocos2d::Touch*)> _onTouchEndedCallback;
  
  };
  
  #endif /* TouchInterceptingLayer_hpp */