-
Notifications
You must be signed in to change notification settings - Fork 1
/
MenuItem.h
55 lines (46 loc) · 1.21 KB
/
MenuItem.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _MENU_ITEM_H_
#define _MENU_ITEM_H_
#include <string>
#include <memory>
#include "Vector.h"
namespace typing
{
class MenuItem
{
public:
// Ctors/Dtors
MenuItem(const juzutil::Vector2& origin, const std::string& text, unsigned int itemID, float height, bool selected)
: m_origin(origin), m_text(text), m_id(itemID), m_height(height), m_selected(selected)
{
}
// Methods
static void Init();
void Draw();
void Select(bool select)
{
m_selected = select;
}
bool IsSelected() const
{
return m_selected;
}
unsigned int GetID() const
{
return m_id;
}
private:
// Constants
static const std::string FONT;
static const float BORDER_GAP_X;
static const float BORDER_GAP_Y;
static const float BORDER_LINE_LENGTH;
// Members
juzutil::Vector2 m_origin;
std::string m_text;
unsigned int m_id;
float m_height;
bool m_selected;
};
typedef std::shared_ptr<MenuItem> MenuItemPtr;
}
#endif // _MENU_ITEM_H_