diff options
| author | Jeffery Myers <[email protected]> | 2021-03-22 23:51:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-23 07:51:52 +0100 |
| commit | e48b9a6da1d3dd6163b1596e47c58e7026530dc1 (patch) | |
| tree | 9d1bca87d19ae07f7605c112c53971531b109dc2 /examples/text/text_font_spritefont.c | |
| parent | c6dd41495b2c0d96cf4d1ca108729ec87c9a0b53 (diff) | |
| download | raylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.tar.gz raylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.zip | |
[Examples] Warning fixes (pt 1) (#1668)
* Fix some warnings in examples.
* cleanups from review
Co-authored-by: Jeffery Myers <[email protected]>
Diffstat (limited to 'examples/text/text_font_spritefont.c')
| -rw-r--r-- | examples/text/text_font_spritefont.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/text/text_font_spritefont.c b/examples/text/text_font_spritefont.c index 4a62c718..0f4a08b2 100644 --- a/examples/text/text_font_spritefont.c +++ b/examples/text/text_font_spritefont.c @@ -38,14 +38,14 @@ int main(void) Font font2 = LoadFont("resources/custom_alagard.png"); // Font loading Font font3 = LoadFont("resources/custom_jupiter_crash.png"); // Font loading - Vector2 fontPosition1 = { screenWidth/2 - MeasureTextEx(font1, msg1, font1.baseSize, -3).x/2, + Vector2 fontPosition1 = { screenWidth/2 - MeasureTextEx(font1, msg1, (float)font1.baseSize, -3).x/2, screenHeight/2 - font1.baseSize/2 - 80 }; - Vector2 fontPosition2 = { screenWidth/2 - MeasureTextEx(font2, msg2, font2.baseSize, -2).x/2, + Vector2 fontPosition2 = { screenWidth/2 - MeasureTextEx(font2, msg2, (float)font2.baseSize, -2).x/2, screenHeight/2 - font2.baseSize/2 - 10 }; - Vector2 fontPosition3 = { screenWidth/2 - MeasureTextEx(font3, msg3, font3.baseSize, 2).x/2, - screenHeight/2 - font3.baseSize/2 + 50 }; + Vector2 fontPosition3 = { screenWidth/2.0f - MeasureTextEx(font3, msg3, (float)font3.baseSize, 2).x/2, + screenHeight/2.0f - font3.baseSize/2 + 50 }; SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -64,9 +64,9 @@ int main(void) ClearBackground(RAYWHITE); - DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, WHITE); - DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, WHITE); - DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, WHITE); + DrawTextEx(font1, msg1, fontPosition1, (float)font1.baseSize, -3, WHITE); + DrawTextEx(font2, msg2, fontPosition2, (float)font2.baseSize, -2, WHITE); + DrawTextEx(font3, msg3, fontPosition3, (float)font3.baseSize, 2, WHITE); EndDrawing(); //---------------------------------------------------------------------------------- |
