//
// Created by sebastian on 10.02.26.
//

#include "UiText.h"

#include <utility>

#include "../text/Font.h"

UiText::UiText(Font &font, std::string text, LayoutStyle& style, glm::vec3 color): font(font), text(std::move(text)), color(color), UiComponent(style) {

}

UiText::UiText(Font &font, std::string text, LayoutStyle& style) : font(font), text(std::move(text)), UiComponent(style), color(glm::vec3(0.f)) {
}

void UiText::setText(const std::string &text) {
    this->text = text;
}

void UiText::onCollectRenderData(UiRenderBundle& ui_render_bundle) {
    if (!visible) return;

    ui_render_bundle.addText(this);
}
