VN System improved.

This commit is contained in:
2022-11-19 13:42:04 -08:00
parent 1e8dfa7388
commit 4eeecced2f
28 changed files with 577 additions and 154 deletions

View File

@ -4,7 +4,7 @@
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DAWN_TARGET_NAME}
PRIVATE
PokerGameTextbox.cpp
)
# target_sources(${DAWN_TARGET_NAME}
# PRIVATE
# PokerGameTextbox.cpp
# )

View File

@ -1,12 +0,0 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "PokerGameTextbox.hpp"
using namespace Dawn;
std::shared_ptr<VisualNovelTextbox> PokerGameTextbox::makeTextbox() {
return nullptr;
}

View File

@ -5,10 +5,28 @@
#pragma once
#include "visualnovel/ui/VisualNovelTextbox.hpp"
#include "asset/assets/TextureAsset.hpp"
#include "asset/assets/TrueTypeAsset.hpp"
namespace Dawn {
class PokerGameTextbox {
public:
static std::shared_ptr<VisualNovelTextbox> makeTextbox();
static VisualNovelTextbox * create(UICanvas *canvas) {
auto textbox = canvas->addElement<VisualNovelTextbox>();
auto assetFont = canvas->getGame()->assetManager.load<TrueTypeAsset>("truetype_ark");
auto assetTexture = canvas->getGame()->assetManager.load<TextureAsset>("texture_test");
textbox->setBorder(&assetTexture->texture, glm::vec2(16, 16));
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
);
return textbox;
}
};
}