-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuPrincipal.cpp
More file actions
43 lines (34 loc) · 992 Bytes
/
MenuPrincipal.cpp
File metadata and controls
43 lines (34 loc) · 992 Bytes
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
#include "MenuPrincipal.h"
#include "RaylibWrapper.h"
#include "settings.h"
#include <string>
MenuPrincipal::MenuPrincipal() : Scene(Menu)
{
}
void MenuPrincipal::Init()
{
Vec2<float> dimensions{ 150, 75 };
int nbButtons = 3;
float screenXcenter = stg::screenWidth / 2.0f;
float posY = stg::screenHeight / static_cast<float>(nbButtons + 1);
_play.Init({ screenXcenter, posY * 3 }, dimensions, "Jouer", VERTFONCE);
}
void MenuPrincipal::Update()
{
Vec2<float> mousePos = raywrp::GetMousePositionV();
_play.Update(mousePos);
}
void MenuPrincipal::Draw()
{
Scene::Draw();
std::string copyright{ "Copyright 2023 - KrakenWood (Bastien)" };
int textLength{ raywrp::MesureText(copyright, 20) };
raywrp::DrawTextV(copyright, { float(stg::screenWidth - textLength), float(stg::screenHeight - 20)}, 20, BLANC);
raywrp::DrawTextV("Jeu", { -69, -69 }, 50, BLANC);
_play.Draw();
}
bool MenuPrincipal::IsSceneSwitching()
{
return _play.IsClicked();
}
// Remettre la variable a faux