-
Notifications
You must be signed in to change notification settings - Fork 0
/
digital_display.cpp
30 lines (25 loc) · 1.03 KB
/
digital_display.cpp
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
#include "digital_display.h"
namespace minis
{
DigitalDisplay::DigitalDisplay(Rectangle bounds) : background(bounds)
{
this->inner_background = Rectangle{
bounds.x + inner_offset, bounds.y + inner_offset,
bounds.width - inner_offset * 2, bounds.height - inner_offset * 2};
}
void DigitalDisplay::Update() {}
void DigitalDisplay::Draw(char *text)
{
DrawRectangle(background.x, background.y, background.width, background.height, DARKGRAY);
DrawRectangle(inner_background.x, inner_background.y, inner_background.width, inner_background.height, BLACK);
DrawText(text, inner_background.x + 2, inner_background.y + 2, 35, GREEN);
}
void DigitalDisplay::SetPosition(Vector2 position)
{
background.x = position.x;
background.y = position.y;
this->inner_background = Rectangle{
background.x + inner_offset, background.y + inner_offset,
background.width - inner_offset * 2, background.height - inner_offset * 2};
}
}