GestureSample.h 813 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef GESTURESAMPLE_H_
  2. #define GESTURESAMPLE_H_
  3. #include "gameplay.h"
  4. #include "Sample.h"
  5. using namespace gameplay;
  6. /**
  7. * Samples gestures.
  8. */
  9. class GestureSample : public Sample
  10. {
  11. public:
  12. GestureSample();
  13. void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
  14. void gestureSwipeEvent(int x, int y, int direction);
  15. void gesturePinchEvent(int x, int y, float scale);
  16. void gestureTapEvent(int x, int y);
  17. void gestureLongTapEvent(int x, int y, float duration);
  18. void gestureDragEvent(int x, int y);
  19. void gestureDropEvent(int x, int y);
  20. protected:
  21. void initialize();
  22. void finalize();
  23. void update(float elapsedTime);
  24. void render(float elapsedTime);
  25. private:
  26. Font* _font;
  27. std::list<std::string> _eventLog;
  28. };
  29. #endif