diff --git a/Ui/debug.c b/Ui/debug.c index 03fa708..676a06b 100644 --- a/Ui/debug.c +++ b/Ui/debug.c @@ -7,7 +7,7 @@ void DebugDraw(Game *game, UiContainer *uiContainer){ - char strings[10][41]; // Platz für bis zu 10 Strings der Länge 40 + char strings[30][41]; // Platz für bis zu 30 Strings der Länge 40 int lineamount = 0; // sollte aktuell gehalten werden, wie viele Lines sind aktuell im Strings Array int neededWidth = MeasureText("1234567890123456789012345", DEBUG_FONT_SIZE); // sollte an den längsten debug String angepasst werden, damit dieser noch reinpasst @@ -21,6 +21,13 @@ void DebugDraw(Game *game, UiContainer *uiContainer){ sprintf(strings[lineamount++], "Selected Layer: %d", game->inputHandler->selectedLayer); sprintf(strings[lineamount++], "DEPTH: %d", (int)(game->inputHandler->cursorWorldPos.x + game->inputHandler->cursorWorldPos.y + game->inputHandler->selectedLayer)); sprintf(strings[lineamount++], "Camera Zoom: %f", game->camera->zoom); + + // Hier müssten wir eine bessere Lösung finden, das flackert weil pressed nur für einen Frame gilt. Eine ähnliche Funktion gibt es für CharDown leider nicht, müssten wir selbst programmieren. Ich habe es erstmal nicht auskommentiert. Kann man aber easy machen sollte es stören + int pressed = GetCharPressed(); + while(pressed != 0){ + sprintf(strings[lineamount++], "Ḱey Pressed: %c", pressed); + pressed = GetCharPressed(); + } // Drawed eine Box für die Debug Info DrawRectangleLines(0, 0, neededWidth, lineamount * DEBUG_FONT_SIZE + 5, (Color){0, 0, 0, 255}); diff --git a/main.c b/main.c index ea99216..48d3786 100644 --- a/main.c +++ b/main.c @@ -81,7 +81,14 @@ int main(){ // darkened background + "Paused" Text DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), (Color){0, 0, 0, 150}); int textWidthHalf = MeasureText("Paused", 28) / 2; - DrawText("Paused", GetScreenWidth()/2 - textWidthHalf, GetScreenHeight()/2 - 14, 28, WHITE); + DrawText("Paused", GetScreenWidth()/2 - textWidthHalf, GetScreenHeight()/4 - 14, 28, WHITE); + + // Controls lol + DrawText("I: Zoom in", 5, GetScreenHeight()/2, 16, WHITE); + DrawText("K: Zoom out", 5, GetScreenHeight()/2 + 16, 16, WHITE); + DrawText("P: Pause", 5, GetScreenHeight()/2 + 32, 16, WHITE); + DrawText("WASD: Move Camera", 5, GetScreenHeight()/2 + 48, 16, WHITE); + DrawText("ESC: Exit Game", 5, GetScreenHeight()/2 + 64, 16, WHITE); // Button / UI stuff UiContainerUpdateUiContainer(pauseScreenUiContainer, game);