-
Notifications
You must be signed in to change notification settings - Fork 0
/
TitleScene.cpp
60 lines (44 loc) · 1.63 KB
/
TitleScene.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
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
56
57
58
59
60
#include "TitleScene.hpp"
#include "Constants.hpp"
#include <string>
#include <fstream>
void TitleScene::Update()
{
m_Ui.Update(NULL);
const Font font = m_Ui.GetFont();
const float fontSize = m_Ui.GetFontSize();
const float fontSpacing = m_Ui.GetFontSpacing();
const char* titleText = "Agile Battle!";
const char* enterToBeginInstructionText = "Pressione enter ou clique para iniciar!";
const char* pressFInstructionText = "Pressione a tecla F para deixar o jogo em tela cheia.";
Vector2 titleTextSize = MeasureTextEx(font, titleText, fontSize, fontSpacing);
Vector2 enterToBeginInstructionTextSize = MeasureTextEx(font, enterToBeginInstructionText, fontSize, fontSpacing);
Vector2 pressFInstructionTextSize = MeasureTextEx(font, pressFInstructionText, fontSize - 24, fontSpacing);
Vector2 titleTextPos = { (Constants::DEFAULT_WIDTH / 2) - (titleTextSize.x / 2), (Constants::DEFAULT_HEIGHT / 2) - (titleTextSize.y / 2) };
Vector2 enterToBeginInstructionTextPos = {
(Constants::DEFAULT_WIDTH / 2) - (enterToBeginInstructionTextSize.x / 2),
(Constants::DEFAULT_HEIGHT / 2) + (enterToBeginInstructionTextSize.y / 2)
};
Vector2 pressFInstructionTextPos = {
(Constants::DEFAULT_WIDTH / 2) - (pressFInstructionTextSize.x / 2),
(Constants::DEFAULT_HEIGHT / 2) + (pressFInstructionTextSize.y / 2) + 100.0f
};
DrawTextEx(font,
titleText,
titleTextPos,
fontSize,
fontSpacing,
BLACK);
DrawTextEx(font,
enterToBeginInstructionText,
enterToBeginInstructionTextPos,
fontSize,
fontSpacing,
BLACK);
DrawTextEx(font,
pressFInstructionText,
pressFInstructionTextPos,
fontSize - 24,
fontSpacing,
BLACK);
}