diff options
| author | nathan <nathansmith@disroot.org> | 2025-12-18 11:23:16 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-12-18 11:23:16 +0000 |
| commit | 8394a306ed1d8dfdc9ca72e4c2c7888a4b79c576 (patch) | |
| tree | 8abba02b0218631224b59a8e1165abda64bcf550 /src/game.c | |
| parent | bcdd09d5075c9755538a93db8e3ca2690a803cc1 (diff) | |
| download | FindThings-8394a306ed1d8dfdc9ca72e4c2c7888a4b79c576.tar.gz FindThings-8394a306ed1d8dfdc9ca72e4c2c7888a4b79c576.tar.bz2 FindThings-8394a306ed1d8dfdc9ca72e4c2c7888a4b79c576.zip | |
A lot of code for a lot of nothing
Diffstat (limited to 'src/game.c')
| -rw-r--r-- | src/game.c | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -152,6 +152,38 @@ void drawCrosshair(float crossHairSize, float crossHairThickness, Color color) crossHairThickness, color); } +void updateGameEntityInfo(Game* game) +{ + // Get size. + float screenWidth = GetRenderWidth(); + float screenHeight = GetRenderWidth(); + float x = game->map.rect.x + (game->map.rect.width * 0.25); + float y = game->map.rect.y + game->map.rect.height; + + int lines = 1; + int fontSize = game->settings.entityInfoFontSize; + + if (!game->map.isEnabled) + { + y = 0.0; + } + + WorldUID selected = game->player.selectedEntity; + + if (selected == ENTITY_NONE) + { + return; + } + + Color backgroundColor = PINK; + backgroundColor.a = game->settings.entityInfoAlpha; + DrawRectangle(x, y, screenWidth - x, lines * fontSize, backgroundColor); + + // Draw name. + Entity* selectedEntity = &game->world.entities[selected]; + DrawText(getEntityName(selectedEntity->id), x, y, fontSize, BLACK); +} + void updateGameScene(Game* game) { // Handle toggle cursor. @@ -189,6 +221,7 @@ void updateGameScene(Game* game) drawGameScreen(game); updateMap(&game->map, game); + updateGameEntityInfo(game); updateInteractionChat(&game->chat, game); // Cross hair. |
