-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTitle.cpp
More file actions
52 lines (51 loc) · 1.54 KB
/
Copy pathTitle.cpp
File metadata and controls
52 lines (51 loc) · 1.54 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
43
44
45
46
47
48
49
50
51
52
#include "main.h"
///タイトルシーン
void Title::Init()
{
titleFont = Font(128);
copyright = Font(30);
getData().beforeMenu = 0;
//ボタン大きさの初期化
button[0] = Button(U"ノートの編集", 60, Vec2(WINDOW_X - W_CENTER, 330), WINDOW_X, 100, false,true);
button[1] = Button(U"ノートの確認", 60, Vec2(WINDOW_X - W_CENTER, 480), WINDOW_X, 100, false,true);
button[2] = Button(U"各設定" , 60, Vec2(WINDOW_X - W_CENTER, 630), WINDOW_X, 100, false,true);
button[3] = Button(U"終了" , 60, Vec2(WINDOW_X - W_CENTER, WINDOW_Y-140), WINDOW_X, 100, false,true);
}
void Title::update()
{
if (getData().changeScene)
{
ScreenCapture::GetFrame(getData().data_fadeTex);
changeScene(getData().toScene, (getData().beforeMenu!=0)?0:500, true);
getData().changeScene = false;
}
//ボタン
for (auto i : step(4))
button[i].update();
//ボタンクリックでシーンチェンジ
if (button[0].Click()) {
getData().beforeMenu = 1;
getData().ChangeStart(sceneName::Loading);
}
if (button[1].Click()){
getData().beforeMenu = 2;
getData().ChangeStart(sceneName::Loading);
}
if (button[2].Click())
getData().ChangeStart(sceneName::Config);
if (button[3].Click())
System::Exit();
if (MouseR.down()) {
getData().beforeMenu = 1;
getData().ChangeStart(sceneName::WriteMain);
}
}
void Title::draw() const
{
//タイトル
titleFont(U"MarkStudy").draw(Arg::topCenter = Vec2(W_CENTER, 50));
copyright(COPYRIGHT).draw(Arg::bottomCenter = Vec2(W_CENTER, WINDOW_Y));
//ボタン
for (auto i : step(4))
button[i].draw();
}