VN System improved.
This commit is contained in:
@ -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
|
||||
# )
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user