summaryrefslogtreecommitdiffhomepage
path: root/examples/text/text_sprite_fonts.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/text/text_sprite_fonts.c')
-rw-r--r--examples/text/text_sprite_fonts.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/examples/text/text_sprite_fonts.c b/examples/text/text_sprite_fonts.c
index 30028937..b7c9ab10 100644
--- a/examples/text/text_sprite_fonts.c
+++ b/examples/text/text_sprite_fonts.c
@@ -29,16 +29,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, fontPosition2, fontPosition3;
+ Vector2 fontPosition1 = { screenWidth/2 - MeasureTextEx(font1, msg1, font1.baseSize, -3).x/2,
+ screenHeight/2 - font1.baseSize/2 - 80 };
- fontPosition1.x = screenWidth/2 - MeasureTextEx(font1, msg1, font1.baseSize, -3).x/2;
- fontPosition1.y = screenHeight/2 - font1.baseSize/2 - 80;
+ Vector2 fontPosition2 = { screenWidth/2 - MeasureTextEx(font2, msg2, font2.baseSize, -2).x/2,
+ screenHeight/2 - font2.baseSize/2 - 10 };
- fontPosition2.x = screenWidth/2 - MeasureTextEx(font2, msg2, font2.baseSize, -2).x/2;
- fontPosition2.y = screenHeight/2 - font2.baseSize/2 - 10;
-
- fontPosition3.x = screenWidth/2 - MeasureTextEx(font3, msg3, font3.baseSize, 2).x/2;
- fontPosition3.y = screenHeight/2 - font3.baseSize/2 + 50;
+ Vector2 fontPosition3 = { screenWidth/2 - MeasureTextEx(font3, msg3, font3.baseSize, 2).x/2,
+ screenHeight/2 - font3.baseSize/2 + 50 };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------