|
Unravel Engine C++ Reference
|
Component that holds a reference to a UI document for RmlUi rendering. More...
#include <ui_document_component.h>
Public Member Functions | |
| auto | get_world_space_scale () const -> math::vec2 |
| auto | get_bounds () const -> math::bbox |
| Gets the bounding box of the document. | |
| auto | is_loaded () const -> bool |
| Check if document is currently loaded. | |
| auto | is_enabled () const -> bool |
| Check if document is currently enabled. | |
| void | set_enabled (bool enabled) |
| Set the enabled state of the document. | |
Public Member Functions inherited from unravel::owned_component | |
| auto | operator= (const owned_component &other) -> owned_component &=default |
| void | set_owner (entt::handle owner) |
| Sets the owner of the component. | |
| auto | get_owner () const noexcept -> entt::const_handle |
| Gets the owner of the component. | |
| auto | get_owner () noexcept -> entt::handle |
| Gets the owner of the component. | |
Public Member Functions inherited from unravel::basic_component | |
| void | touch () |
| Marks the component as 'touched'. | |
Public Attributes | |
| asset_handle< ui_tree > | asset |
| Path to the UI document file (HTML/RML) | |
| Rml::Context * | context = nullptr |
| Per-document RmlUi context (owned by this component) | |
| Rml::ElementDocument * | document = nullptr |
| Loaded RmlUi document (owned by context) | |
| uint64_t | version = 0 |
| ui_render_mode | render_mode = ui_render_mode::screen_space_overlay |
| Rendering mode: screen or world. | |
| usize32_t | size = {512, 512} |
| Document resolution (pixels). For screen-space: viewport size. For world-space: configurable (e.g. 512×512) | |
| float | pixels_per_world_unit = UI_DEFAULT_PIXELS_PER_WORLD_UNIT |
| Pixels per world unit for world-space rendering (default: 100, Unity-style) | |
| gfx::frame_buffer::ptr | framebuffer |
| Framebuffer for world-space render-to-texture (owned by component) | |
| uint32_t | last_render_frame = 0 |
| Last frame this world-space document was rendered (for render-once-per-frame) | |
| std::shared_ptr< RmlUi_RenderLayerStack > | render_layer_stack |
| Render layer stack for this document (owned by component, used during render pass) | |
Public Attributes inherited from unravel::basic_component | |
| bool | eto {} |
| Disable empty type optimizations. | |
Additional Inherited Members | |
Public Types inherited from unravel::component_crtp< ui_document_component, owned_component > | |
| using | base |
Static Public Member Functions inherited from unravel::owned_component | |
| template<typename T > | |
| static void | on_create_component (entt::registry &r, entt::entity e) |
| template<typename T > | |
| static void | on_destroy_component (entt::registry &r, entt::entity e) |
Static Public Attributes inherited from unravel::component_crtp< ui_document_component, owned_component > | |
| static constexpr bool | in_place_delete |
| Indicates if the component can be deleted in place. | |
Component that holds a reference to a UI document for RmlUi rendering.
Supports both screen-space and world-space rendering via context-per-document and render-to-texture. Each document has its own RmlUi context and framebuffer.
Definition at line 41 of file ui_document_component.h.
| auto unravel::ui_document_component::get_bounds | ( | ) | const -> math::bbox |
Gets the bounding box of the document.
Definition at line 17 of file ui_document_component.cpp.
| auto unravel::ui_document_component::get_world_space_scale | ( | ) | const -> math::vec2 |
Definition at line 11 of file ui_document_component.cpp.
|
nodiscard |
Check if document is currently enabled.
Definition at line 34 of file ui_document_component.cpp.
|
nodiscard |
Check if document is currently loaded.
Definition at line 29 of file ui_document_component.cpp.
| void unravel::ui_document_component::set_enabled | ( | bool | enabled | ) |
Set the enabled state of the document.
| enabled | True if document should be enabled |
Definition at line 39 of file ui_document_component.cpp.
| asset_handle<ui_tree> unravel::ui_document_component::asset |
Path to the UI document file (HTML/RML)
Definition at line 44 of file ui_document_component.h.
| Rml::Context* unravel::ui_document_component::context = nullptr |
Per-document RmlUi context (owned by this component)
Definition at line 47 of file ui_document_component.h.
| Rml::ElementDocument* unravel::ui_document_component::document = nullptr |
Loaded RmlUi document (owned by context)
Definition at line 50 of file ui_document_component.h.
| gfx::frame_buffer::ptr unravel::ui_document_component::framebuffer |
Framebuffer for world-space render-to-texture (owned by component)
Definition at line 63 of file ui_document_component.h.
| uint32_t unravel::ui_document_component::last_render_frame = 0 |
Last frame this world-space document was rendered (for render-once-per-frame)
Definition at line 66 of file ui_document_component.h.
| float unravel::ui_document_component::pixels_per_world_unit = UI_DEFAULT_PIXELS_PER_WORLD_UNIT |
Pixels per world unit for world-space rendering (default: 100, Unity-style)
Definition at line 60 of file ui_document_component.h.
| std::shared_ptr<RmlUi_RenderLayerStack> unravel::ui_document_component::render_layer_stack |
Render layer stack for this document (owned by component, used during render pass)
Definition at line 69 of file ui_document_component.h.
| ui_render_mode unravel::ui_document_component::render_mode = ui_render_mode::screen_space_overlay |
Rendering mode: screen or world.
Definition at line 55 of file ui_document_component.h.
| usize32_t unravel::ui_document_component::size = {512, 512} |
Document resolution (pixels). For screen-space: viewport size. For world-space: configurable (e.g. 512×512)
Definition at line 58 of file ui_document_component.h.
| uint64_t unravel::ui_document_component::version = 0 |
Definition at line 52 of file ui_document_component.h.