-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimage-button-widget.hh
More file actions
42 lines (35 loc) · 1.06 KB
/
Copy pathimage-button-widget.hh
File metadata and controls
42 lines (35 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef _GRAVITY_IMAGE_BUTTON_WIDGET_HH_
#define _GRAVITY_IMAGE_BUTTON_WIDGET_HH_
#include "image-widget.hh"
#include "resource-cache.hh"
#define BUTTON_CLICK 1000
#define BUTTON_MOUSE_ENTER 1001
#define BUTTON_MOUSE_LEAVE 1002
class ImageButtonWidget : public ImageWidget {
protected:
float activeColorR;
float activeColorG;
float activeColorB;
float activeColorA;
float inactiveColorR;
float inactiveColorG;
float inactiveColorB;
float inactiveColorA;
bool isActive;
bool mouseDown;
public:
ImageButtonWidget(Screen *screen,
ResourceCache::Texture texture,
float x,
float y,
float height,
TextAnchor xanchor,
TextAnchor yanchor,
const SDL_Color &activeColor,
const SDL_Color &inactiveColor);
virtual void HandleEvent(const SDL_Event &e);
virtual void Advance(float dt);
virtual void Render(Renderer *renderer);
virtual void Reset();
};
#endif /* _GRAVITY_IMAGE_BUTTON_WIDGET_HH_ */