aboutsummaryrefslogtreecommitdiff
path: root/game/hud/HudSubScene.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-06 13:34:27 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-06 13:34:27 +0100
commita216cfc457cdde754c5673e9423d00147a2f1574 (patch)
treec38213bb40881cda872fb4b9720d3349fb3e3e9c /game/hud/HudSubScene.cpp
parent3297acbb3687d8a98a11a1ca26a766db3d85501b (diff)
fps in hud
Diffstat (limited to 'game/hud/HudSubScene.cpp')
-rw-r--r--game/hud/HudSubScene.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/game/hud/HudSubScene.cpp b/game/hud/HudSubScene.cpp
index 126f933..dd36d1c 100644
--- a/game/hud/HudSubScene.cpp
+++ b/game/hud/HudSubScene.cpp
@@ -28,9 +28,17 @@ void HudSubScene::create(Scene & scn){
// Coins
GameObject hud_coin = scn.new_object(HUD_COINS);
- crepe::vec2 size = {COINS_CHAR_WIDTH*COINS_LENGTH,(COINS_CHAR_WIDTH)*2};
- hud_coin.add_component<Text>(size, FONT,Text::Data{
+ crepe::vec2 size_coin = {COINS_CHAR_WIDTH*COINS_LENGTH,(COINS_CHAR_WIDTH)*2};
+ hud_coin.add_component<Text>(size_coin, FONT,Text::Data{
.world_space = false,
.text_color = Color::YELLOW,
}, TOP_LEFT+FONTOFFSET+COINS_OFFSET + vec2{COINS_LENGTH * COINS_CHAR_WIDTH/2,0}, COINS);
+
+ // Fps
+ GameObject hud_fps = scn.new_object(HUD_FPS);
+ crepe::vec2 size_fps = {FPS_CHAR_WIDTH*FPS_LENGTH,(FPS_CHAR_WIDTH)*2};
+ hud_fps.add_component<Text>(size_fps, FONT,Text::Data{
+ .world_space = false,
+ .text_color = Color::GREEN,
+ }, TOP_LEFT+FONTOFFSET+FPS_OFFSET + vec2{FPS_LENGTH * FPS_CHAR_WIDTH/2,0}, FPS);
}