raylibstarter
0.1.0
menu_scene.cpp
Go to the documentation of this file.
1
#include <string>
2
3
#include <raylib-cpp.hpp>
4
#include <raylib.h>
5
6
#include <
store.h
>
7
8
#include "
scenes.h
"
9
10
using namespace
std::string_literals;
11
12
game::scenes::MenuScene::MenuScene
() {
13
// Your scene initialization code here...
14
}
15
16
game::scenes::MenuScene::~MenuScene
() {
17
// Your scene cleanup code here...
18
}
19
20
void
game::scenes::MenuScene::Update
() {
21
// Your process input and update game scene code here...
22
if
(IsKeyPressed(KEY_ENTER))
23
game::core::Store::stage
->replaceWithNewScene(
"menu"
s,
"game"
s, std::make_unique<GameScene>());
24
}
25
26
void
game::scenes::MenuScene::Draw
() {
27
// Your scene drawing code here...
28
// Note that scene-actors are drawn automatically
29
DrawText(
"Menu - press ENTER to load game scene"
, 10, 10, 30, LIGHTGRAY);
30
}
game::scenes::MenuScene::Draw
void Draw() override
The Draw() method can be used to output graphics. Note that the elements of the actor map are drawn a...
Definition:
menu_scene.cpp:26
game::scenes::MenuScene::MenuScene
MenuScene()
Definition:
menu_scene.cpp:12
game::scenes::MenuScene::Update
void Update() override
The Update() method is used to process input and update the game state. It is called automatically be...
Definition:
menu_scene.cpp:20
game::scenes::MenuScene::~MenuScene
~MenuScene() override
Definition:
menu_scene.cpp:16
scenes.h
store.h
game::core::Store::stage
static std::unique_ptr< game::core::Stage > stage
The Stage object is responsible for the scene change and for updating and drawing the scene contents.
Definition:
store.h:16
src
scenes
menu_scene.cpp
Generated by
1.9.3