diff --git a/src/main.cpp b/src/main.cpp index 4af4f75..beae60d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -259,11 +259,16 @@ int main(int argc, char *argv[]) { } BeginDrawing(); - ClearBackground(DARKGRAY); + ClearBackground(BLACK); Vector2 winwidth = (Vector2) {(float) GetScreenWidth(), (float) GetScreenHeight()}; Vector2 imagesize = (Vector2) {(float) current_player.tex.tex.width, (float) current_player.tex.tex.height}; - DrawTextureEx(current_player.tex.tex, (Vector2) {0,0}, 0, ScaleToFit(imagesize, winwidth), WHITE); + + Vector2 scaledsize = Vector2Scale(imagesize, ScaleToFit(imagesize, winwidth)); + Vector2 fpos; + fpos.x = (winwidth.x *0.5) - (scaledsize.x * 0.5f); + fpos.y = (winwidth.y *0.5) - (scaledsize.y * 0.5f); + DrawTextureEx(current_player.tex.tex, fpos, 0, ScaleToFit(imagesize, winwidth), WHITE); @@ -370,4 +375,4 @@ int main(int argc, char *argv[]) { //-------------------------------------------------------------------------------------- curl_global_cleanup(); return 0; -} +} \ No newline at end of file