23#define KTECH_DEFINITION
24#include "../ktech.hpp"
25#undef KTECH_DEFINITION
26#include "../utility/id.hpp"
27#include "../basic/cella.hpp"
28#include "../basic/rgba.hpp"
29#include "../basic/point.hpp"
30#include "../basic/upoint.hpp"
55 uint8_t
m_alpha = std::numeric_limits<uint8_t>::max();
74 virtual auto OnTick() -> bool;
79 inline void RenderBackground();
82 inline void RenderForeground();
Complete engine containing all engine components.
Definition engine.hpp:41
Engine component responsible for registering all world structures.
Definition memory.hpp:36
World structure that contains and renders Widgets.
Definition ui.hpp:46
auto AddWidget(const ID< Widget > &widget) -> bool
Add a Widget.
Definition ui.cpp:56
std::string m_name
String name.
Definition ui.hpp:50
uint8_t m_alpha
Opacity for all rendered Widgets.
Definition ui.hpp:55
UI(Engine &engine, UPoint resolution=UPoint(10, 10), std::string name="")
Construct a UI.
Definition ui.cpp:34
std::vector< ID< Widget > > m_widgets
Contained Widgets.
Definition ui.hpp:51
void Render()
Render all contained Widgets.
Definition ui.cpp:132
const ID< UI > m_id
Personal ID.
Definition ui.hpp:49
auto RemoveWidget(const ID< Widget > &widget) -> bool
Remove a Widget.
Definition ui.cpp:80
void Resize(UPoint resolution)
Resize the image's resolution.
Definition ui.cpp:123
auto RemoveAllWidgets() -> bool
Remove all contained Widget.
Definition ui.cpp:101
RGBA m_brgba
Background color added after rendering Widgets.
Definition ui.hpp:57
std::vector< CellA > m_image
CellA-based rendered image.
Definition ui.hpp:58
virtual auto OnTick() -> bool
Virtual function called once each tick.
Definition ui.cpp:218
UPoint m_res
Image's resolution.
Definition ui.hpp:53
CellA m_background
The background to render upon.
Definition ui.hpp:54
void RenderClearDrawPrint()
Shortcut for UI::Render(), Output::Clear(), UI::Draw() and Output::Print().
Definition ui.cpp:186
Engine & engine
Parent Engine.
Definition ui.hpp:48
RGBA m_frgba
Foreground color added after rendering Widgets.
Definition ui.hpp:56
void Draw(Point position=Point(0, 0), UPoint start=UPoint(0, 0), UPoint end=UPoint(0, 0), uint8_t alpha=std::numeric_limits< uint8_t >::max())
Draw the rendered image (UI::m_image) to Output so it can be printed to the terminal.
Definition ui.cpp:170
virtual ~UI()
Remove all Widgets from itself, and itself from Memory.
Definition ui.cpp:44
Like Cell, but with RGBA foreground and background colors, instead of RGB.
Definition cella.hpp:32
Serializable world structure identifier.
Definition id.hpp:38
2D vector, mostly used to store positions and directions.
Definition point.hpp:30
Like RGB, but also has an alpha channel representing transparency.
Definition rgba.hpp:30
A CellA-based sprite.
Definition texture.hpp:48
Unsigned 2D vector, mostly used to store sizes and 2D indexes.
Definition upoint.hpp:29