Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
controls_table.hpp
Go to the documentation of this file.
1
3#pragma once
4
8#include <aegis2d/render/export.hpp>
10
11#include <span>
12
13namespace aegis2d::render {
14
22 float column_gap = 24.0F;
24 float row_gap = 6.0F;
25};
26
33[[nodiscard]] AEGIS2D_RENDER_EXPORT Vec2
34measure_controls(const BitmapFont& font, std::span<const platform::ControlLine> lines,
35 const ControlsTableStyle& style) noexcept;
36
45AEGIS2D_RENDER_EXPORT Vec2 draw_controls(IRenderer& renderer, const BitmapFont& font,
46 std::span<const platform::ControlLine> lines,
47 Vec2 position, const ControlsTableStyle& style);
48
49} // namespace aegis2d::render
Text drawn with a bitmap font, through the sprite batcher.
Monospaced font whose glyphs are cells of a texture, drawn as sprites.
Definition bitmap_font.hpp:68
What the game draws with, whatever the graphics API behind it.
Definition renderer.hpp:81
The game's controls in words, for a reminder screen or a settings menu.
Vector and matrix types of the engine (GLM behind engine names).
OpenGL renderer: sprites, text and camera (client only).
Definition bitmap_font.hpp:16
aegis2d::Vec2 Vec2
2D vector of floats, in logical pixels: the engine-wide aegis2d::Vec2.
Definition renderer.hpp:17
Vec2 draw_controls(IRenderer &renderer, const BitmapFont &font, std::span< const platform::ControlLine > lines, Vec2 position, const ControlsTableStyle &style)
Draws a controls table: actions in a column, their keys aligned in a second one.
Vec2 measure_controls(const BitmapFont &font, std::span< const platform::ControlLine > lines, const ControlsTableStyle &style) noexcept
Size a controls table takes.
Backend-independent renderer interface and the sprite it draws.
Styles and spacing of a controls table.
Definition controls_table.hpp:16
TextStyle keys
Style of the keys column.
Definition controls_table.hpp:20
TextStyle action
Style of the action column.
Definition controls_table.hpp:18
float column_gap
Space between the two columns, in logical pixels.
Definition controls_table.hpp:22
float row_gap
Space between two rows, in logical pixels, added to the line height.
Definition controls_table.hpp:24
How a text is drawn.
Definition bitmap_font.hpp:49