Oxygine  1
2g game engine
Button.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "Sprite.h"
4 namespace oxygine
5 {
6  DECLARE_SMART(Button, spButton);
7 
8  class Button: public Sprite
9  {
10  INHERITED(Sprite);
11  public:
12  DECLARE_COPYCLONE_NEW(Button);
13 
14  Button();
15  ~Button();
16 
17  int getRow() const {return _row;}
18 
19  void setResAnim(const ResAnim* r, int col = 0, int row = 0) override;
20 
22  void setRow(int row);
23 
24  protected:
25  enum state
26  {
27  stateNormal,
28  stateOvered,
29  statePressed
30  };
31  virtual void updateButtonState(state s);
32 
33  const ResAnim* _resAnim;
34  int _row;
35  state _state;
36 
37  private:
38  pointer_index _btnPressed;
39  pointer_index _btnOvered;
40 
41  void _mouseEvent(Event* event);
42 
43  void setState(state s);
44  };
45 }
46 
47 EDITOR_INCLUDE(Button);
Definition: Sprite.h:14
Definition: Event.h:10
void setRow(int row)
–oxgl-end–!
Definition: Actor.h:14
Definition: Button.h:8
Definition: ResAnim.h:13