Oxygine  1
2g game engine
TouchEvent.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "Event.h"
4 #undef OUT
5 namespace oxygine
6 {
7  class TouchEvent : public Event
8  {
9  public:
10  enum
11  {
12  __FIRST = sysEventID('T', 'O', 0),
13 
14  CLICK,
15  OVER,
16  OUT,
17  MOVE,
18  TOUCH_DOWN,
19  TOUCH_UP,
20  WHEEL_UP,//DEPRECATED, use WHEEL_DIR with TouchEvent::wheelDirection
21  WHEEL_DOWN,//DEPRECATED, use WHEEL_DIR with TouchEvent::wheelDirection
22  WHEEL_DIR,
23 
24  __LAST//system
25  };
26 
27 
28  TouchEvent(eventType type, bool Bubbles = true, const Vector2& locPosition = Vector2(0, 0)) : Event(type, Bubbles), localPosition(locPosition), position(locPosition), mouseButton(MouseButton_Touch), pressure(1.0f), index(1), __clickDispatched(false), wheelDirection(0, 0), __localScale(1.0f) {}
29 
34 
35  float pressure;
36 
37  MouseButton mouseButton;
38  pointer_index index;
39 
40  Vector2 wheelDirection;//actual only for WHEEL_DIR event
41 
42  const PointerState* getPointer() const;
43 
44  static bool isTouchEvent(int eventID) { return eventID > __FIRST && eventID < __LAST; }
45 
46  bool __clickDispatched;
47  float __localScale;
48  };
49 }
Definition: Event.h:10
Vector2 position
Definition: TouchEvent.h:33
–oxgl-end–!
Definition: Actor.h:14
Definition: PointerState.h:18
Vector2 localPosition
Definition: TouchEvent.h:31
Definition: TouchEvent.h:7