Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::ui_system Class Reference

System responsible for managing user interface components and rendering. More...

#include <ui_system.h>

Public Member Functions

auto init (rtti::context &ctx) -> bool
 Initializes the UI system with the given context.
 
auto deinit (rtti::context &ctx) -> bool
 Deinitializes the UI system with the given context.
 
void on_frame_update (rtti::context &ctx, delta_t dt)
 Update UI system (called every frame)
 
void on_frame_render (const gfx::frame_buffer::ptr &output, delta_t dt)
 Render UI (called every frame after update)
 
auto get_context () -> Rml::Context *
 Get the main RmlUi context.
 
void on_os_event (rtti::context &ctx, os::event &event)
 Handle OS events and forward to RmlUi.
 
void load_fonts ()
 Load fonts.
 
void register_component_callbacks (rtti::context &ctx)
 Register component creation/destruction callbacks with ECS.
 

Static Public Member Functions

static void on_create_component (entt::registry &r, entt::entity e)
 
static void on_destroy_component (entt::registry &r, entt::entity e)
 

Detailed Description

System responsible for managing user interface components and rendering.

This system integrates RmlUi for HTML/CSS-based user interfaces with the engine's rendering and input systems. It provides a high-level API for loading and managing UI documents.

Definition at line 33 of file ui_system.h.

Member Function Documentation

◆ deinit()

auto unravel::ui_system::deinit ( rtti::context & ctx) -> bool

Deinitializes the UI system with the given context.

Parameters
ctxThe context to deinitialize.
Returns
True if deinitialization was successful, false otherwise.

Definition at line 100 of file ui_system.cpp.

◆ get_context()

auto unravel::ui_system::get_context ( ) -> Rml::Context*

Get the main RmlUi context.

Returns
Pointer to RmlUi context, or nullptr if not initialized

Definition at line 174 of file ui_system.cpp.

◆ init()

auto unravel::ui_system::init ( rtti::context & ctx) -> bool

Initializes the UI system with the given context.

Parameters
ctxThe context to initialize with.
Returns
True if initialization was successful, false otherwise.

Definition at line 42 of file ui_system.cpp.

◆ load_fonts()

void unravel::ui_system::load_fonts ( )

Load fonts.

Definition at line 271 of file ui_system.cpp.

◆ on_create_component()

void unravel::ui_system::on_create_component ( entt::registry & r,
entt::entity e )
static

Definition at line 307 of file ui_system.cpp.

◆ on_destroy_component()

void unravel::ui_system::on_destroy_component ( entt::registry & r,
entt::entity e )
static

Definition at line 311 of file ui_system.cpp.

◆ on_frame_render()

void unravel::ui_system::on_frame_render ( const gfx::frame_buffer::ptr & output,
delta_t dt )

Render UI (called every frame after update)

Parameters
outputOutput frame buffer
dtDelta time since last frame

Definition at line 155 of file ui_system.cpp.

◆ on_frame_update()

void unravel::ui_system::on_frame_update ( rtti::context & ctx,
delta_t dt )

Update UI system (called every frame)

Parameters
ctxEngine context
dtDelta time since last frame

Definition at line 139 of file ui_system.cpp.

◆ on_os_event()

void unravel::ui_system::on_os_event ( rtti::context & ctx,
os::event & event )

Handle OS events and forward to RmlUi.

Parameters
ctxEngine context
eventOS event to process

Definition at line 180 of file ui_system.cpp.

◆ register_component_callbacks()

void unravel::ui_system::register_component_callbacks ( rtti::context & ctx)

Register component creation/destruction callbacks with ECS.

Parameters
ctxEngine context

Definition at line 321 of file ui_system.cpp.


The documentation for this class was generated from the following files: