Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/windowing/StarLabelWidget.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-08-02 19:29:21 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-08-02 19:29:21 +1000
commit994c533a0f7b4aa1a1530405505a53546252e1d1 (patch)
tree3e190174ef93a35f53b842c61098544df8216356 /source/windowing/StarLabelWidget.cpp
parent856e93be3f1a443db2679ad7db9f6890a9b4d936 (diff)
Improve planet name title
They began showing during the warp cinematic and their fade-out timing was wrong.
Diffstat (limited to 'source/windowing/StarLabelWidget.cpp')
-rw-r--r--source/windowing/StarLabelWidget.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/windowing/StarLabelWidget.cpp b/source/windowing/StarLabelWidget.cpp
index cfc273c..30b1451 100644
--- a/source/windowing/StarLabelWidget.cpp
+++ b/source/windowing/StarLabelWidget.cpp
@@ -41,6 +41,10 @@ void LabelWidget::setFontSize(int fontSize) {
updateTextRegion();
}
+void LabelWidget::setFontMode(FontMode fontMode) {
+ m_fontMode = fontMode;
+}
+
void LabelWidget::setColor(Color newColor) {
m_color = move(newColor);
}
@@ -82,6 +86,7 @@ RectI LabelWidget::getScissorRect() const {
void LabelWidget::renderImpl() {
context()->setFont(m_font);
context()->setFontSize(m_fontSize);
+ context()->setFontMode(m_fontMode);
context()->setFontColor(m_color.toRgba());
context()->setFontProcessingDirectives(m_processingDirectives);
@@ -93,6 +98,7 @@ void LabelWidget::renderImpl() {
context()->renderInterfaceText(m_text, {Vec2F(screenPosition()), m_hAnchor, m_vAnchor, m_wrapWidth, m_textCharLimit});
context()->setDefaultFont();
+ context()->setFontMode(FontMode::Normal);
context()->setFontProcessingDirectives("");
context()->setDefaultLineSpacing();
}