Fixed more font stuff, works really really good now.

This commit is contained in:
2023-01-14 23:34:15 -08:00
parent 2e55754c49
commit dbe2409287
16 changed files with 87 additions and 27 deletions

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
);
}