// Copyright (c) 2022 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #pragma once #include "prefabs/UIBorderPrefab.hpp" #include "visualnovel/ui/VisualNovelTextbox.hpp" namespace Dawn { class VisualNovelTextboxPrefab : public UIPrefab { public: static std::vector getAssets(AssetManager *man) { std::vector assets{ man->get("truetype_ark") }; vectorAppend(&assets, &UIBorderPrefab::getAssets(man)); return assets; } static void uiApply(VisualNovelTextbox *textbox) override { assertNotNull(textbox); auto assetFont = textbox->getGame()->assetManager.get("truetype_ark"); UIBorderPrefab::uiApply(&textbox->border); textbox->setFont(&assetFont->font); textbox->setFontSize(40); textbox->setLabelPadding(glm::vec2(10, 8)); textbox->setTransform( UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_END, glm::vec4(0, 238, 0, 0), 0.0f ); } } }