Rally Rush
Loading...
Searching...
No Matches
menu_ui.hpp
Go to the documentation of this file.
1#ifndef MENU_UI_HPP
2#define MENU_UI_HPP
3
4#include "godot_cpp/classes/control.hpp"
5#include <godot_cpp/classes/canvas_layer.hpp>
6#include <godot_cpp/classes/node3d.hpp>
7#include <godot_cpp/classes/packed_scene.hpp>
8
9namespace godot {
11class MenuUI : public CanvasLayer {
12 GDCLASS(MenuUI, CanvasLayer);
13 static void _bind_methods();
14public:
16 virtual void _ready() override;
18 void start_game();
20 void toggle_controls();
22 void set_game_scene(Ref<PackedScene> scene);
24 Ref<PackedScene> get_game_scene() const;
25private:
26 Control *controls{nullptr};
27 Ref<PackedScene> game_scene{};
28};
29}
30
31#endif // !MENU_UI_HPP
The main menu UI parent.
Definition menu_ui.hpp:11
Ref< PackedScene > get_game_scene() const
The scene to load when the start button is pressed.
Definition menu_ui.cpp:37
void start_game()
Load the game scene. Listener for start button "button_down" observer.
Definition menu_ui.cpp:25
GDCLASS(MenuUI, CanvasLayer)
void toggle_controls()
Show the controls screen. Listener for controls button "button_down" observer.
Definition menu_ui.cpp:29
virtual void _ready() override
Register listeners with UI action observers. Get the controls panel child and hide it.
Definition menu_ui.cpp:15
void set_game_scene(Ref< PackedScene > scene)
The scene to load when the start button is pressed.
Definition menu_ui.cpp:33
Ref< PackedScene > game_scene
Definition menu_ui.hpp:27
static void _bind_methods()
Definition menu_ui.cpp:10
Control * controls
Definition menu_ui.hpp:26
Definition beacon_powerup.cpp:6