-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawUtils3.hpp
More file actions
36 lines (30 loc) · 1.53 KB
/
Copy pathDrawUtils3.hpp
File metadata and controls
36 lines (30 loc) · 1.53 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
#ifndef DRAWUTILS3_HPP
#define DRAWUTILS3_HPP
struct ScreenPoint {
ScreenPoint(unsigned short i, unsigned short j);
ScreenPoint();
unsigned short i;
unsigned short j;
};
struct ScreenRect {
ScreenRect(ScreenPoint p1, ScreenPoint p2);
ScreenRect(ScreenPoint p1, unsigned short width, unsigned short height);
ScreenRect(unsigned short i1, unsigned short j1, unsigned short i2, unsigned short j2);
unsigned short width();
unsigned short height();
bool isPointInside(ScreenPoint p) const;
ScreenPoint p1;
ScreenPoint p2;
};
class DrawUtils3 {
public:
static void drawLineHorizontal(unsigned short y, unsigned short start, unsigned short end, unsigned short color);
static void drawLineVertical(unsigned short x, unsigned short start, unsigned short end, unsigned short color);
static void drawRect(ScreenRect r, unsigned short color);
static void drawOutlinedRect(ScreenRect r, unsigned short color, unsigned short outlineColor);
static void drawChar(ScreenPoint pos, char ch, unsigned short color);
static void drawString(ScreenPoint pos, const char *str, unsigned short color);
static ScreenRect drawTextBoxOneLine(ScreenPoint pos, const char *str, unsigned short padding, unsigned short color, unsigned short bg, unsigned short outline);
static ScreenRect drawMenuItemWithArrows(ScreenPoint pos, const char *str, const char *option, unsigned short padding, unsigned short color, unsigned short bg, unsigned short outline, bool arrows);
};
#endif