9#include <aegis2d/ui/export.hpp>
87 [[nodiscard]]
float value() const noexcept;
91 void set_value(
float value) noexcept;
107 void draw(render::IRenderer& renderer, const
WidgetTree& tree,
162 std::size_t visible,
WidgetId group = root);
170 [[nodiscard]]
std::span<const
std::
string> items() const noexcept;
174 [[nodiscard]]
std::
size_t selected() const noexcept;
179 void select(
std::
size_t item);
183 [[nodiscard]]
std::
size_t top() const noexcept;
187 [[nodiscard]]
std::
size_t visible() const noexcept;
204 void draw(render::IRenderer& renderer, const
WidgetTree& tree, const render::BitmapFont& font,
208 void show_selection() noexcept;
210 std::vector<
std::
string> items_;
212 std::
size_t visible_ = 1;
213 std::
size_t selected_ = 0;
214 std::
size_t top_ = 0;
Text drawn with a bitmap font, through the sprite batcher.
A scrollable list of items, one selected, as a widget of a WidgetTree.
Definition widgets.hpp:151
WidgetId id() const noexcept
The list's widget in its tree.
ListView(WidgetTree &tree, render::Rect bounds, std::vector< std::string > items, std::size_t visible, WidgetId group=root)
Adds the list to a tree.
A value picked between two bounds, as a widget of a WidgetTree.
Definition widgets.hpp:65
Slider(WidgetTree &tree, render::Rect bounds, const SliderConfig &config, WidgetId group=root)
Adds the slider to a tree.
WidgetId id() const noexcept
The slider's widget in its tree.
RGBA color used by the renderer.
Vector and matrix types of the engine (GLM behind engine names).
constexpr Color rgb(std::uint32_t hex, float alpha=1.0F) noexcept
Color from its hexadecimal sRGB code, as design tools and palettes give it.
Definition color.hpp:25
Menus and forms: widgets and their focus, moved by keyboard, gamepad and mouse (client only).
Definition console.hpp:21
std::size_t WidgetId
Identifier of a widget in its WidgetTree, given by WidgetTree::add().
Definition widget_tree.hpp:18
constexpr WidgetId root
The root group of every tree, which the other widgets go under.
Definition widget_tree.hpp:21
Definition endpoint.hpp:85
Backend-independent renderer interface and the sprite it draws.
RGBA color with components in [0, 1].
Definition color.hpp:10
Axis-aligned rectangle.
Definition renderer.hpp:20
Colors, text size and layer of a ListView.
Definition widgets.hpp:117
render::Color selected
Background of the selected row.
Definition widgets.hpp:121
render::Color disabled
Text and rows of a disabled list.
Definition widgets.hpp:125
std::int32_t layer
Layer of the rows; the text and the scrollbar go one layer above.
Definition widgets.hpp:135
render::Color outline
Outline around the focused list.
Definition widgets.hpp:127
render::Color scrollbar
The scrollbar on the right edge, shown when some items are off screen.
Definition widgets.hpp:129
float text_scale
Scale of the text at 100%, multiplied by the tree's scale.
Definition widgets.hpp:133
render::Color background
Background of the rows.
Definition widgets.hpp:119
render::Color text
Text of the rows.
Definition widgets.hpp:123
float outline_width
Width of the outline and the scrollbar, in logical pixels at 100%.
Definition widgets.hpp:131
What the player asked of the focus during a frame.
Definition widget_tree.hpp:37
Range, step and starting value of a Slider.
Definition widgets.hpp:23
float step
How much one Left or Right moves the value, above 0.
Definition widgets.hpp:29
float value
Starting value, clamped between min and max.
Definition widgets.hpp:31
float max
Value at the right end, above min.
Definition widgets.hpp:27
float min
Value at the left end.
Definition widgets.hpp:25
Colors and layer of a Slider.
Definition widgets.hpp:37
std::int32_t layer
Layer of the track; the fill and the handle go one layer above.
Definition widgets.hpp:51
float outline_width
Width of the outline, in logical pixels at 100%.
Definition widgets.hpp:49
render::Color fill
The filled part of the track, up to the value.
Definition widgets.hpp:41
render::Color outline
Outline around the focused slider.
Definition widgets.hpp:47
render::Color disabled
Track, fill and handle of a disabled slider.
Definition widgets.hpp:45
render::Color handle
The handle at the value.
Definition widgets.hpp:43
render::Color track
The groove the handle slides in.
Definition widgets.hpp:39