|
Aegis2D
Modular C++26 2D game engine for networked games
|
Reads the focus moves of a frame from the keyboard, a gamepad and the mouse. More...
#include <aegis2d/ui/navigation.hpp>
Public Member Functions | |
| NavigationInput () | |
| Declares the navigation actions with their default keys and buttons. | |
| platform::ActionMap & | actions () noexcept |
| The navigation actions, to remap, save and load them. | |
| const platform::ActionMap & | actions () const noexcept |
| The navigation actions. | |
| Navigation | read (const platform::Keyboard &keyboard, const platform::Gamepad &gamepad, const platform::Mouse &mouse, Vec2 pointer) const |
| What the player asked of the focus during the frame. | |
Reads the focus moves of a frame from the keyboard, a gamepad and the mouse.
Has its own actions, so the menus keep their keys whatever the game binds: ui-up, ui-down, ui-left and ui-right on the arrows, the D-pad and the left stick; ui-next on Tab and the right shoulder; ui-previous on the left shoulder, and Tab pressed with a Shift key held; ui-activate on Enter, Space and the South button (A, Cross). The player can remap them like any action (actions(), then ActionMap::save() and load() in a section of their own, such as "ui").
| aegis2d::ui::NavigationInput::NavigationInput | ( | ) |
Declares the navigation actions with their default keys and buttons.
|
noexcept |
The navigation actions.
ui-up to ui-activate.
|
noexcept |
The navigation actions, to remap, save and load them.
ui-up to ui-activate. | Navigation aegis2d::ui::NavigationInput::read | ( | const platform::Keyboard & | keyboard, |
| const platform::Gamepad & | gamepad, | ||
| const platform::Mouse & | mouse, | ||
| Vec2 | pointer | ||
| ) | const |
What the player asked of the focus during the frame.
A direction pressed during the frame, the first of up, down, left and right; Tab or a shoulder button; ui-activate pressed, and held with the main mouse button; the mouse's position as pointer when it moved or its main button went down.
| keyboard | Keyboard of the frame. |
| gamepad | Gamepad of the frame. |
| mouse | Mouse of the frame. |
| pointer | The mouse's position in logical pixels, from render::opengl::Renderer::to_logical(). |