summaryrefslogtreecommitdiff
path: root/ui/gameMainSelector.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-27 21:47:41 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-27 21:47:41 +0000
commite0ac130808d9bed5443115ee91e9cccda713ae3c (patch)
treedad2b2cbe2bc8bf5560f4859880549472f808671 /ui/gameMainSelector.cpp
parentRemove the static texture cache (diff)
parentRender text in N draw calls (diff)
downloadilt-e0ac130808d9bed5443115ee91e9cccda713ae3c.tar.bz2
ilt-e0ac130808d9bed5443115ee91e9cccda713ae3c.tar.xz
ilt-e0ac130808d9bed5443115ee91e9cccda713ae3c.zip
Merge branch 'text2'
Diffstat (limited to 'ui/gameMainSelector.cpp')
-rw-r--r--ui/gameMainSelector.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/gameMainSelector.cpp b/ui/gameMainSelector.cpp
index a577838..5bef48d 100644
--- a/ui/gameMainSelector.cpp
+++ b/ui/gameMainSelector.cpp
@@ -8,14 +8,16 @@
#include <game/selectable.h>
#include <game/worldobject.h> // IWYU pragma: keep
#include <gfx/gl/camera.h>
-#include <math.h>
#include <optional>
-#include <span>
#include <stream_support.h>
#include <typeinfo>
-#include <vector>
-GameMainSelector::GameMainSelector(const Camera * c, ScreenAbsCoord size) : UIComponent {{{}, size}}, camera {c} { }
+const std::filesystem::path fontpath {"/usr/share/fonts/hack/Hack-Regular.ttf"};
+
+GameMainSelector::GameMainSelector(const Camera * c, ScreenAbsCoord size) :
+ UIComponent {{{}, size}}, camera {c}, font {fontpath, 15}
+{
+}
constexpr ScreenAbsCoord TargetPos {5, 45};
@@ -26,7 +28,7 @@ GameMainSelector::render(const UIShader & shader, const Position & parentPos) co
target->render(shader, parentPos + position + TargetPos);
}
if (!clicked.empty()) {
- Text {clicked, {{50, 10}, {0, 15}}, {1, 1, 0}}.render(shader, parentPos);
+ Text {clicked, font, {{50, 10}, {0, 15}}, {1, 1, 0}}.render(shader, parentPos);
}
}