TextRenderableConfig.ixx File
Fluent configuration for text renderable GameObjects. More...
Included Headers
#include <memory>
#include <string>
#include <cassert>
#include <helios.engine.builder.gameObject.builders.configs.SceneNodeConfig>
#include <helios.engine.modules.ui>
#include <helios.scene.SceneNode>
#include <helios.math.types>
#include <helios.engine.modules.rendering>
#include <helios.ext.opengl>
#include <helios.core.types>
#include <helios.engine.modules.ui.widgets.types.FontId>
#include <helios.rendering>
#include <helios.engine.ecs.GameObject>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | builder |
|
Fluent builder pattern for constructing GameObjects. More... | |
| namespace | gameObject |
|
Factory and prototype classes for GameObject construction. More... | |
| namespace | builders |
|
Domain-specific builders for configuring different aspects of GameObjects. More... | |
| namespace | configs |
|
Fine-grained configuration classes for component setup. More... | |
Classes Index
| class | TextRenderableConfig |
|
Fluent configuration for text renderable GameObjects. More... | |
Description
Fluent configuration for text renderable GameObjects.
File Listing
The file content with the documentation metadata removed is:
28export namespace helios::engine::builder::gameObject::builders::configs {
36 class TextRenderableConfig {
41 helios::engine::ecs::GameObject gameObject_;
46 helios::rendering::text::FontResourceProvider* fontResourceProvider_;
56 helios::math::vec4f color_;
127 explicit TextRenderableConfig(
129 ) : gameObject_(gameObject) {}
138 TextRenderableConfig& shader(const std::shared_ptr<helios::ext::opengl::rendering::shader::LegacyOpenGLShader>& shader) {
139 shader_ = std::move(shader);
151 TextRenderableConfig& color(const helios::math::vec4f color) {
152 color_ = color;
166 build();
168 SceneNodeConfig scn{gameObject_};
170 scn.parent(parent);
182 SceneNodeConfig attachTo(helios::scene::SceneNode* parent) {
184 build();
186 SceneNodeConfig scn{gameObject_};
188 scn.parent(parent);
200 TextRenderableConfig& fontResourceProvider(helios::rendering::text::FontResourceProvider& provider) {
224 TextRenderableConfig& formattedAsNumber(std::string numberFormat = "{:.0f}") {
239 TextRenderableConfig& formattedAsTimestamp(std::string timestampFormat) {
256 TextRenderableConfig& useElapsedLabel(std::string label) {
295 TextRenderableConfig& text(std::string text) {
296 text_ = std::move(text);
308 fontId_ = fontId;
319 TextRenderableConfig& fontScale(const float fontScale) {
320 fontScale_ = fontScale;
333 TextRenderableConfig& build() {
337 auto shaderProperties = std::make_shared<helios::rendering::text::TextShaderProperties>(color_);
348 gameObject_.add<helios::engine::modules::rendering::renderable::components::RenderableComponent>(renderable);
350 auto& msc = gameObject_.getOrAdd<helios::engine::modules::rendering::model::components::ModelAabbComponent>();
354 gameObject_.add<helios::engine::modules::ui::widgets::components::UiTextComponent>(renderable.get());
359 auto& tfc = gameObject_.add<helios::engine::modules::ui::layout::components::TimeFormatterComponent>();
360 tfc.setFormat(
362 displayRemaining_ ? modules::ui::layout::types::TimeDisplayMode::Remaining
373 gameObject_.add<helios::engine::modules::ui::layout::components::NumberFormatterComponent>()
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.