FormsSample.h 980 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 controlEvent(Control* control, EventType evt);
  17. private:
  18. void formChanged();
  19. void createSampleForm();
  20. Scene* _scene;
  21. Node* _formNode;
  22. Node* _formNodeParent;
  23. Form* _formSelect;
  24. Form* _activeForm;
  25. std::vector<Form*> _forms;
  26. Gamepad* _gamepad;
  27. unsigned int _keyFlags;
  28. bool _touched;
  29. int _touchX;
  30. unsigned int _formIndex;
  31. std::vector<const char*> _formFiles;
  32. std::string _sampleString;
  33. Vector2 _joysticks[2];
  34. };
  35. #endif