mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-18 07:41:47 +00:00
Update text_raylib_fonts.c
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [text] example - raylib fonts loading
|
* raylib [text] example - sprite fonts loading
|
||||||
*
|
*
|
||||||
* Example complexity rating: [★☆☆☆] 1/4
|
* Example complexity rating: [★☆☆☆] 1/4
|
||||||
*
|
*
|
||||||
@@ -30,19 +30,19 @@ int main(void)
|
|||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [text] example - raylib fonts");
|
InitWindow(screenWidth, screenHeight, "raylib [text] example - sprite fonts");
|
||||||
|
|
||||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||||
Font fonts[MAX_FONTS] = { 0 };
|
Font fonts[MAX_FONTS] = { 0 };
|
||||||
|
|
||||||
fonts[0] = LoadFont("resources/fonts/alagard.png");
|
fonts[0] = LoadFont("resources/sprite_fonts/alagard.png");
|
||||||
fonts[1] = LoadFont("resources/fonts/pixelplay.png");
|
fonts[1] = LoadFont("resources/sprite_fonts/pixelplay.png");
|
||||||
fonts[2] = LoadFont("resources/fonts/mecha.png");
|
fonts[2] = LoadFont("resources/sprite_fonts/mecha.png");
|
||||||
fonts[3] = LoadFont("resources/fonts/setback.png");
|
fonts[3] = LoadFont("resources/sprite_fonts/setback.png");
|
||||||
fonts[4] = LoadFont("resources/fonts/romulus.png");
|
fonts[4] = LoadFont("resources/sprite_fonts/romulus.png");
|
||||||
fonts[5] = LoadFont("resources/fonts/pixantiqua.png");
|
fonts[5] = LoadFont("resources/sprite_fonts/pixantiqua.png");
|
||||||
fonts[6] = LoadFont("resources/fonts/alpha_beta.png");
|
fonts[6] = LoadFont("resources/sprite_fonts/alpha_beta.png");
|
||||||
fonts[7] = LoadFont("resources/fonts/jupiter_crash.png");
|
fonts[7] = LoadFont("resources/sprite_fonts/jupiter_crash.png");
|
||||||
|
|
||||||
const char *messages[MAX_FONTS] = { "ALAGARD FONT designed by Hewett Tsoi",
|
const char *messages[MAX_FONTS] = { "ALAGARD FONT designed by Hewett Tsoi",
|
||||||
"PIXELPLAY FONT designed by Aleksander Shevchuk",
|
"PIXELPLAY FONT designed by Aleksander Shevchuk",
|
||||||
@@ -87,8 +87,8 @@ int main(void)
|
|||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
DrawText("free fonts included with raylib", 250, 20, 20, DARKGRAY);
|
DrawText("free sprite fonts included with raylib", 220, 20, 20, DARKGRAY);
|
||||||
DrawLine(220, 50, 590, 50, DARKGRAY);
|
DrawLine(220, 50, 600, 50, DARKGRAY);
|
||||||
|
|
||||||
for (int i = 0; i < MAX_FONTS; i++)
|
for (int i = 0; i < MAX_FONTS; i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user