Pokergame commit
This commit is contained in:
@ -37,7 +37,7 @@ float_t TrueTypeFont::getScale(float_t scale) {
|
|||||||
|
|
||||||
float_t TrueTypeFont::getSpaceSize(float_t fontSize) {
|
float_t TrueTypeFont::getSpaceSize(float_t fontSize) {
|
||||||
assertTrue(fontSize > 0);
|
assertTrue(fontSize > 0);
|
||||||
return this->getScale(fontSize) * 18;
|
return this->getScale(fontSize) * 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
float_t TrueTypeFont::getInitialLineHeight(float_t fontSize) {
|
float_t TrueTypeFont::getInitialLineHeight(float_t fontSize) {
|
||||||
@ -47,7 +47,7 @@ float_t TrueTypeFont::getInitialLineHeight(float_t fontSize) {
|
|||||||
|
|
||||||
float_t TrueTypeFont::getLineHeight(float_t fontSize) {
|
float_t TrueTypeFont::getLineHeight(float_t fontSize) {
|
||||||
assertTrue(fontSize > 0);
|
assertTrue(fontSize > 0);
|
||||||
return 96.0f * this->getScale(fontSize);
|
return 128.0f * this->getScale(fontSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrueTypeFont::buffer(
|
void TrueTypeFont::buffer(
|
||||||
|
@ -32,6 +32,6 @@ tool_texture(texture_test texture_test.png)
|
|||||||
tool_language(locale_poker ${DIR_GAME_ASSETS}/locale/locale.xml)
|
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_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_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_audio(audio_test borrowed/sample_short.wav)
|
||||||
tool_vnscene(Scene_1 ${DIR_GAME_ASSETS}/vn/Scene_1.xml)
|
tool_vnscene(Scene_1 ${DIR_GAME_ASSETS}/vn/Scene_1.xml)
|
@ -1,43 +1,43 @@
|
|||||||
// Copyright (c) 2023 Dominic Masters
|
// Copyright (c) 2023 Dominic Masters
|
||||||
//
|
//
|
||||||
// This software is released under the MIT License.
|
// This software is released under the MIT License.
|
||||||
// https://opensource.org/licenses/MIT
|
// https://opensource.org/licenses/MIT
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "prefabs/ui/UIBorderPrefab.hpp"
|
#include "prefabs/ui/UIBorderPrefab.hpp"
|
||||||
#include "visualnovel/ui/VisualNovelTextbox.hpp"
|
#include "visualnovel/ui/VisualNovelTextbox.hpp"
|
||||||
|
|
||||||
namespace Dawn {
|
namespace Dawn {
|
||||||
class VisualNovelTextboxPrefab :
|
class VisualNovelTextboxPrefab :
|
||||||
public UIPrefab<VisualNovelTextbox, VisualNovelTextboxPrefab>
|
public UIPrefab<VisualNovelTextbox, VisualNovelTextboxPrefab>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
||||||
std::vector<Asset*> assets;
|
std::vector<Asset*> assets;
|
||||||
assets.push_back(man->get<TrueTypeAsset>("truetype_alice"));
|
assets.push_back(man->get<TrueTypeAsset>("truetype_bizudp"));
|
||||||
vectorAppend(&assets, UIBorderPrefab::getRequiredAssets(man));
|
vectorAppend(&assets, UIBorderPrefab::getRequiredAssets(man));
|
||||||
return assets;
|
return assets;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prefabApply(AssetManager *man, VisualNovelTextbox *textbox) {
|
static void prefabApply(AssetManager *man, VisualNovelTextbox *textbox) {
|
||||||
auto assetFont = man->get<TrueTypeAsset>("truetype_alice");
|
auto assetFont = man->get<TrueTypeAsset>("truetype_bizudp");
|
||||||
UIBorderPrefab::apply(&textbox->border);
|
UIBorderPrefab::apply(&textbox->border);
|
||||||
textbox->setFont(&assetFont->font);
|
textbox->setFont(&assetFont->font);
|
||||||
textbox->setFontSize(48.0f);
|
textbox->setFontSize(36.0f);
|
||||||
textbox->setLabelPadding(glm::vec2(2, 2));
|
textbox->setLabelPadding(glm::vec2(2, 2));
|
||||||
textbox->label.textColor = COLOR_WHITE;
|
textbox->label.textColor = COLOR_WHITE;
|
||||||
|
|
||||||
textbox->setTransform(
|
textbox->setTransform(
|
||||||
UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_END,
|
UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_END,
|
||||||
glm::vec4(
|
glm::vec4(
|
||||||
0,
|
0,
|
||||||
(assetFont->font.getLineHeight(textbox->getFontSize()) * 4) +
|
(assetFont->font.getLineHeight(textbox->getFontSize()) * 4) +
|
||||||
(textbox->border.getBorderSize().y * 2.0f) +
|
(textbox->border.getBorderSize().y * 2.0f) +
|
||||||
(textbox->getLabelPadding().y * 2.0f),
|
(textbox->getLabelPadding().y * 2.0f),
|
||||||
0, 0
|
0, 0
|
||||||
),
|
),
|
||||||
0.0f
|
0.0f
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -92,7 +92,6 @@ int32_t GeneratedLanguages::start() {
|
|||||||
std::cout << "Language " << itLang->first << " is missing key " << key << std::endl;
|
std::cout << "Language " << itLang->first << " is missing key " << key << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
std::cout << "bruh " << exist->second << std::endl;
|
|
||||||
bufferOut += exist->first + "|" + exist->second + "|";
|
bufferOut += exist->first + "|" + exist->second + "|";
|
||||||
++itKeys;
|
++itKeys;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user