parent
67a0aecfa6
commit
2ff46e2582
@ -0,0 +1,29 @@
|
||||
#include "debug.h"
|
||||
#include "../game.h"
|
||||
#include "uiContainer.h"
|
||||
#include "string.h"
|
||||
#include <stdio.h>
|
||||
#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++;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
#ifndef DEBUG_H_
|
||||
#define DEBUG_H_
|
||||
|
||||
#include "../game.h"
|
||||
#include "uiContainer.h"
|
||||
|
||||
#define DEBUG_FONT_SIZE 18
|
||||
|
||||
void DebugDraw(Game *game, UiContainer *uiContainer);
|
||||
|
||||
#endif
|
||||
Loading…
Reference in new issue