Pokergame commit
This commit is contained in:
@ -32,6 +32,6 @@ tool_texture(texture_test texture_test.png)
|
||||
tool_language(locale_poker ${DIR_GAME_ASSETS}/locale/locale.xml)
|
||||
tool_tileset(tileset_death texture_death ${DIR_GAME_ASSETS}/characters/death/sheet.png 1 3)
|
||||
tool_tileset(tileset_penny texture_penny ${DIR_GAME_ASSETS}/characters/penny/sheet.png 1 3)
|
||||
tool_truetype(truetype_alice ${DIR_GAME_ASSETS}/font/Alice-Regular.ttf truetype_alice 2048 2048 120)
|
||||
tool_truetype(truetype_bizudp ${DIR_GAME_ASSETS}/font/BIZUDPGothic-Regular.ttf truetype_bizudp 2048 2048 120)
|
||||
tool_audio(audio_test borrowed/sample_short.wav)
|
||||
tool_vnscene(Scene_1 ${DIR_GAME_ASSETS}/vn/Scene_1.xml)
|
@ -1,43 +1,43 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefabs/ui/UIBorderPrefab.hpp"
|
||||
#include "visualnovel/ui/VisualNovelTextbox.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class VisualNovelTextboxPrefab :
|
||||
public UIPrefab<VisualNovelTextbox, VisualNovelTextboxPrefab>
|
||||
{
|
||||
public:
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
||||
std::vector<Asset*> assets;
|
||||
assets.push_back(man->get<TrueTypeAsset>("truetype_alice"));
|
||||
vectorAppend(&assets, UIBorderPrefab::getRequiredAssets(man));
|
||||
return assets;
|
||||
}
|
||||
|
||||
static void prefabApply(AssetManager *man, VisualNovelTextbox *textbox) {
|
||||
auto assetFont = man->get<TrueTypeAsset>("truetype_alice");
|
||||
UIBorderPrefab::apply(&textbox->border);
|
||||
textbox->setFont(&assetFont->font);
|
||||
textbox->setFontSize(48.0f);
|
||||
textbox->setLabelPadding(glm::vec2(2, 2));
|
||||
textbox->label.textColor = COLOR_WHITE;
|
||||
|
||||
textbox->setTransform(
|
||||
UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_END,
|
||||
glm::vec4(
|
||||
0,
|
||||
(assetFont->font.getLineHeight(textbox->getFontSize()) * 4) +
|
||||
(textbox->border.getBorderSize().y * 2.0f) +
|
||||
(textbox->getLabelPadding().y * 2.0f),
|
||||
0, 0
|
||||
),
|
||||
0.0f
|
||||
);
|
||||
}
|
||||
};
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefabs/ui/UIBorderPrefab.hpp"
|
||||
#include "visualnovel/ui/VisualNovelTextbox.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class VisualNovelTextboxPrefab :
|
||||
public UIPrefab<VisualNovelTextbox, VisualNovelTextboxPrefab>
|
||||
{
|
||||
public:
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
||||
std::vector<Asset*> assets;
|
||||
assets.push_back(man->get<TrueTypeAsset>("truetype_bizudp"));
|
||||
vectorAppend(&assets, UIBorderPrefab::getRequiredAssets(man));
|
||||
return assets;
|
||||
}
|
||||
|
||||
static void prefabApply(AssetManager *man, VisualNovelTextbox *textbox) {
|
||||
auto assetFont = man->get<TrueTypeAsset>("truetype_bizudp");
|
||||
UIBorderPrefab::apply(&textbox->border);
|
||||
textbox->setFont(&assetFont->font);
|
||||
textbox->setFontSize(36.0f);
|
||||
textbox->setLabelPadding(glm::vec2(2, 2));
|
||||
textbox->label.textColor = COLOR_WHITE;
|
||||
|
||||
textbox->setTransform(
|
||||
UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_END,
|
||||
glm::vec4(
|
||||
0,
|
||||
(assetFont->font.getLineHeight(textbox->getFontSize()) * 4) +
|
||||
(textbox->border.getBorderSize().y * 2.0f) +
|
||||
(textbox->getLabelPadding().y * 2.0f),
|
||||
0, 0
|
||||
),
|
||||
0.0f
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user