Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
navigation.hpp
Go to the documentation of this file.
1
3#pragma once
4
10#include <aegis2d/ui/export.hpp>
12
13namespace aegis2d::ui {
14
22class AEGIS2D_UI_EXPORT NavigationInput {
23public:
26
29 [[nodiscard]] platform::ActionMap& actions() noexcept;
30
33 [[nodiscard]] const platform::ActionMap& actions() const noexcept;
34
45 [[nodiscard]] Navigation read(const platform::Keyboard& keyboard,
46 const platform::Gamepad& gamepad, const platform::Mouse& mouse,
47 Vec2 pointer) const;
48
49private:
50 platform::ActionMap actions_;
51 platform::ActionId up_;
52 platform::ActionId down_;
53 platform::ActionId left_;
54 platform::ActionId right_;
55 platform::ActionId next_;
56 platform::ActionId previous_;
57 platform::ActionId activate_;
58};
59
60} // namespace aegis2d::ui
Named actions (move, fire...) bound to keys and gamepad buttons, so gameplay never reads raw input.
Actions of the game and the keys and gamepad buttons that trigger them.
Definition actions.hpp:38
Reads the focus moves of a frame from the keyboard, a gamepad and the mouse.
Definition navigation.hpp:22
platform::ActionMap & actions() noexcept
The navigation actions, to remap, save and load them.
NavigationInput()
Declares the navigation actions with their default keys and buttons.
Gamepad buttons, sticks and triggers, with no SDL type.
Keyboard keys, their names, and the state of the keyboard during a frame.
Vector and matrix types of the engine (GLM behind engine names).
Mouse buttons, and the state of the mouse during a frame.
Menus and forms: widgets and their focus, moved by keyboard, gamepad and mouse (client only).
Definition console.hpp:21
glm::vec2 Vec2
2D vector of floats: positions, velocities, sizes (glm::vec2).
Definition math.hpp:19
What the player asked of the focus during a frame.
Definition widget_tree.hpp:37
Widgets of a menu or a form, and which one has the focus.