#include "debug.h" #include "../game.h" #include "uiContainer.h" #include "string.h" #include #include "../Input/inputHandler.h" void DebugDraw(Game *game, UiContainer *uiContainer){ // Platz für bis zu 10 Strings der Länge 40 char strings[10][41]; int lineamount = 0; sprintf(strings[lineamount++], "Screen: %d", game->screen); sprintf(strings[lineamount++], "MouseScreenX: %d", GetMouseX()); sprintf(strings[lineamount++], "MouseScreenY: %d", GetMouseY()); sprintf(strings[lineamount++], "MouseWorldX: %d", (int)game->inputHandler->cursorWorldPos.x); sprintf(strings[lineamount++], "MouseWorldY: %d", (int)game->inputHandler->cursorWorldPos.y); DrawRectangleLines(0, 0, 200, lineamount * DEBUG_FONT_SIZE + 5, (Color){0, 0, 0, 255}); DrawRectangle(0, 0, 200, lineamount * DEBUG_FONT_SIZE + 5, (Color){0, 0, 0, 150}); int counter = 0; while(counter < lineamount){ DrawText(strings[counter], 2, counter * DEBUG_FONT_SIZE + 2, DEBUG_FONT_SIZE, RED); counter++; } }