FormsSample.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef FORMSSAMPLE_H_
  2. #define FORMSSAMPLE_H_
  3. #include "SamplesGame.h"
  4. using namespace gameplay;
  5. class FormsSample : public Sample, Control::Listener
  6. {
  7. public:
  8. FormsSample();
  9. void gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad);
  10. protected:
  11. void initialize();
  12. void finalize();
  13. void update(float elapsedTime);
  14. void render(float elapsedTime);
  15. void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
  16. void keyEvent(Keyboard::KeyEvent keyEvent, int key);
  17. void controlEvent(Control* control, EventType evt);
  18. private:
  19. void formChanged();
  20. void createSampleForm();
  21. Scene* _scene;
  22. Node* _formNode;
  23. Node* _formNodeParent;
  24. Form* _formSelect;
  25. Form* _activeForm;
  26. std::vector<Form*> _forms;
  27. Gamepad* _gamepad;
  28. unsigned int _keyFlags;
  29. bool _touched;
  30. int _touchX;
  31. unsigned int _formIndex;
  32. std::vector<const char*> _formFiles;
  33. std::string _sampleString;
  34. Vector2 _joysticks[2];
  35. };
  36. #endif