Blame view

ios/Runner/Wowgame/Classes/game_halloween/HTouchInterceptingLayer.h 1.32 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
  //
  //  HTouchInterceptingLayer.hpp
  //  SteveMaggieCpp
  //
  //  Created by Katarzyna Kalinowska-Górska on 12.05.2017.
  //
  //
  
  #ifndef HTouchInterceptingLayer_h
  #define HTouchInterceptingLayer_h
  
  #include <stdio.h>
  #include "cocos2d.h"
  
  class HTouchInterceptingLayer : public cocos2d::LayerColor {
  
      public:
      
          static const int TouchEventListenerPriority = -100;
      
          // create
          static HTouchInterceptingLayer * 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 /* HTouchInterceptingLayer_hpp */