Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ui Namespace Reference

Menus and forms: widgets and their focus, moved by keyboard, gamepad and mouse (client only). More...

Classes

class  Console
 The in-game console: the key under Escape opens it over the game, a command typed on its input line runs with Enter, and the output scrolls above. More...
 
struct  ConsoleLine
 A line of the console's output. More...
 
struct  ConsoleStyle
 Where and how the console is drawn. More...
 
struct  ListStyle
 Colors, text size and layer of a ListView. More...
 
class  ListView
 A scrollable list of items, one selected, as a widget of a WidgetTree. More...
 
class  Menu
 Buttons and labels of a menu, on a WidgetTree. More...
 
struct  MenuStyle
 Colors, text size and layer of a menu. More...
 
struct  Navigation
 What the player asked of the focus during a frame. More...
 
class  NavigationInput
 Reads the focus moves of a frame from the keyboard, a gamepad and the mouse. More...
 
class  Slider
 A value picked between two bounds, as a widget of a WidgetTree. More...
 
struct  SliderConfig
 Range, step and starting value of a Slider. More...
 
struct  SliderStyle
 Colors and layer of a Slider. More...
 
class  TextField
 An editable line of text, as a widget of a WidgetTree. More...
 
struct  TextFieldConfig
 Starting text, placeholder and limit of a TextField. More...
 
struct  TextFieldStyle
 Colors, text size and layer of a TextField. More...
 
class  WidgetTree
 Widgets of a menu or a form, in groups, and which one has the focus. More...
 

Typedefs

using WidgetId = std::size_t
 Identifier of a widget in its WidgetTree, given by WidgetTree::add().
 

Enumerations

enum class  WidgetState : std::uint8_t { Normal , Focused , Pressed , Disabled }
 How a button looks, from what the player does with it. More...
 
enum class  Direction : std::uint8_t { Up , Down , Left , Right }
 Direction the focus moves in, with the arrows, the D-pad or a stick. More...
 

Functions

AEGIS2D_UI_EXPORT std::string_view name () noexcept
 Name of the module, used to check that it is linked.
 

Variables

constexpr WidgetId root = 0
 The root group of every tree, which the other widgets go under.
 

Detailed Description

Menus and forms: widgets and their focus, moved by keyboard, gamepad and mouse (client only).

Typedef Documentation

◆ WidgetId

using aegis2d::ui::WidgetId = typedef std::size_t

Identifier of a widget in its WidgetTree, given by WidgetTree::add().

Enumeration Type Documentation

◆ Direction

enum class aegis2d::ui::Direction : std::uint8_t
strong

Direction the focus moves in, with the arrows, the D-pad or a stick.

Enumerator
Up 

Towards the top of the screen.

Down 

Towards the bottom of the screen.

Left 

Towards the left of the screen.

Right 

Towards the right of the screen.

◆ WidgetState

enum class aegis2d::ui::WidgetState : std::uint8_t
strong

How a button looks, from what the player does with it.

Enumerator
Normal 

Not focused.

Focused 

Focused: activate uses it.

Pressed 

Focused, with the activate key, button or the main mouse button held down.

Disabled 

Cannot be focused or used.

Function Documentation

◆ name()

AEGIS2D_UI_EXPORT std::string_view aegis2d::ui::name ( )
noexcept

Name of the module, used to check that it is linked.

Returns
"ui", a view of a static string.

Variable Documentation

◆ root

constexpr WidgetId aegis2d::ui::root = 0
inlineconstexpr

The root group of every tree, which the other widgets go under.