Skip to main content

UiStyleUpdateSystem Class

System for updating UI text element bounds. More...

Declaration

class helios::engine::modules::ui::widgets::systems::UiStyleUpdateSystem { ... }

Public Member Typedefs Index

usingEngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions Index

voidupdate (helios::engine::runtime::world::UpdateContext &updateContext) noexcept

Updates AABB bounds for text components that need resizing. More...

Description

System for updating UI text element bounds.

Monitors UiTextComponent for resize requests and updates the associated ModelAabbComponent with the new text bounds from the underlying TextRenderable.

Definition at line 35 of file UiStyleUpdateSystem.ixx.

Public Member Typedefs

EngineRoleTag

using helios::engine::modules::ui::widgets::systems::UiStyleUpdateSystem::EngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions

update()

void helios::engine::modules::ui::widgets::systems::UiStyleUpdateSystem::update (helios::engine::runtime::world::UpdateContext & updateContext)
inline noexcept

Updates AABB bounds for text components that need resizing.

Parameters
updateContext

The current frame's update context.

Definition at line 47 of file UiStyleUpdateSystem.ixx.

48
49 for (auto [entity, txt, usy, usc, active] : updateContext.view<
54 >().whereEnabled()) {
55
56
57 auto* renderable = txt->renderable();
58 auto& mesh = renderable->textMesh();
59
60 auto properties = renderable->textShaderPropertiesOverride();
61
62 if (!properties) {
64 properties->baseColor = usy->normalColor();
65 } else {
66 properties = properties->withBaseColor(usy->normalColor());
67 }
68
69 mesh.setFontScale(usy->normalScale());
70
71 if (usc->isSelected()) {
72 properties = properties->withBaseColor(usy->selectedColor());
73 mesh.setFontScale(usy->selectedScale());
74 }
75
76 renderable->setTextShaderPropertiesOverride(properties.value());
77
78 }
79 }

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.