Fixed more font stuff, works really really good now.

This commit is contained in:
2023-01-14 23:34:15 -08:00
parent 0558b3bb25
commit 18d3b074f9
14 changed files with 81 additions and 25 deletions

View File

@ -40,9 +40,9 @@ tool_tileset(tileset_cards texture_cards ${DIR_GAME_ASSETS}/cards.png 14 4)
tool_truetype(truetype_ark
ark-pixel.ttf
truetype_ark
96
96
10
2048
2048
60
)
add_dependencies(${DAWN_TARGET_NAME}

View File

@ -19,7 +19,7 @@ namespace Dawn {
static void prefabApply(AssetManager *man, UIBorder *border) {
auto text = man->get<TextureAsset>("texture_test");
border->texture = &text->texture;
border->setBorderSize(glm::vec2(8, 8));
border->setBorderSize(glm::vec2(4, 4));
}
};
}

View File

@ -22,11 +22,18 @@ namespace Dawn {
auto assetFont = man->get<TrueTypeAsset>("truetype_ark");
UIBorderPrefab::apply(&textbox->border);
textbox->setFont(&assetFont->font);
textbox->setFontSize(11);
textbox->setLabelPadding(glm::vec2(4, 4));
textbox->setFontSize(10.0f);
textbox->setLabelPadding(glm::vec2(2, 2));
textbox->setTransform(
UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_END,
glm::vec4(0, assetFont->font.getLineHeight(textbox->getFontSize()) * 4, 0, 0),
glm::vec4(
0,
(assetFont->font.getLineHeight(textbox->getFontSize()) * 4) +
(textbox->border.getBorderSize().y * 2.0f) +
(textbox->getLabelPadding().y * 2.0f),
0, 0
),
0.0f
);
}

View File

@ -23,7 +23,7 @@ std::vector<Asset*> PokerVNScene::getRequiredAssets() {
}
void PokerVNScene::vnStage() {
this->renderTarget.setClearColor(COLOR_RED);
this->renderTarget.setClearColor(COLOR_BLACK);
this->camera->setRenderTarget(&this->renderTarget);
auto pixelPerfectCamera = this->camera->item->addComponent<PixelPerfectCamera>();

View File

@ -25,7 +25,6 @@ namespace Dawn {
void stage() override {
this->camera = Camera::create(this);
this->camera->transform->lookAt(glm::vec3(300, 300, 300), glm::vec3(0, 0, 0));
this->subScene.stage();

View File

@ -40,7 +40,7 @@ namespace Dawn {
vnManager, &texture->texture
);
start->then(new VisualNovelTextboxEvent(vnManager, penny->getComponent<VisualNovelCharacter>(), "scene.1.1"));
start->then(new VisualNovelTextboxEvent(vnManager, penny->getComponent<VisualNovelCharacter>(), "1234"));
return start;
}