BREAKING CHANGE: Renamed SpriteFont type to Font
- Preparing MP3 files support - Jumped version to raylib 2.0-dev (too many breaking changes...)
This commit is contained in:
parent
6045062a05
commit
ec33e7d705
34 changed files with 3027 additions and 179 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [text] example - BMFont and TTF SpriteFonts loading
|
* raylib [text] example - BMFont and TTF Fonts loading
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.4 (www.raylib.com)
|
* This example has been created using raylib 1.4 (www.raylib.com)
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
|
@ -24,8 +24,8 @@ int main()
|
||||||
const char msgTtf[64] = "THIS SPRITE FONT has been GENERATED from a TTF";
|
const char msgTtf[64] = "THIS SPRITE FONT has been GENERATED from a TTF";
|
||||||
|
|
||||||
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
||||||
SpriteFont fontBm = LoadSpriteFont("resources/bmfont.fnt"); // BMFont (AngelCode)
|
Font fontBm = LoadFont("resources/bmfont.fnt"); // BMFont (AngelCode)
|
||||||
SpriteFont fontTtf = LoadSpriteFont("resources/pixantiqua.ttf"); // TTF font
|
Font fontTtf = LoadFont("resources/pixantiqua.ttf"); // TTF font
|
||||||
|
|
||||||
Vector2 fontPosition;
|
Vector2 fontPosition;
|
||||||
|
|
||||||
|
|
@ -58,8 +58,8 @@ int main()
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadSpriteFont(fontBm); // AngelCode SpriteFont unloading
|
UnloadFont(fontBm); // AngelCode Font unloading
|
||||||
UnloadSpriteFont(fontTtf); // TTF SpriteFont unloading
|
UnloadFont(fontTtf); // TTF Font unloading
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ int main()
|
||||||
const char msg[256] = "ASCII extended characters:\n¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆ\nÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæ\nçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
|
const char msg[256] = "ASCII extended characters:\n¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆ\nÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæ\nçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
|
||||||
|
|
||||||
// NOTE: Loaded font has an unordered list of characters (chars in the range 32..255)
|
// NOTE: Loaded font has an unordered list of characters (chars in the range 32..255)
|
||||||
SpriteFont font = LoadSpriteFont("resources/pixantiqua.fnt"); // BMFont (AngelCode)
|
Font font = LoadFont("resources/pixantiqua.fnt"); // BMFont (AngelCode)
|
||||||
|
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
@ -56,7 +56,7 @@ int main()
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadSpriteFont(font); // AngelCode SpriteFont unloading
|
UnloadFont(font); // AngelCode Font unloading
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -26,16 +26,16 @@ int main()
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [text] example - raylib fonts");
|
InitWindow(screenWidth, screenHeight, "raylib [text] example - raylib 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)
|
||||||
SpriteFont fonts[MAX_FONTS];
|
Font fonts[MAX_FONTS];
|
||||||
|
|
||||||
fonts[0] = LoadSpriteFont("resources/fonts/alagard.png");
|
fonts[0] = LoadFont("resources/fonts/alagard.png");
|
||||||
fonts[1] = LoadSpriteFont("resources/fonts/pixelplay.png");
|
fonts[1] = LoadFont("resources/fonts/pixelplay.png");
|
||||||
fonts[2] = LoadSpriteFont("resources/fonts/mecha.png");
|
fonts[2] = LoadFont("resources/fonts/mecha.png");
|
||||||
fonts[3] = LoadSpriteFont("resources/fonts/setback.png");
|
fonts[3] = LoadFont("resources/fonts/setback.png");
|
||||||
fonts[4] = LoadSpriteFont("resources/fonts/romulus.png");
|
fonts[4] = LoadFont("resources/fonts/romulus.png");
|
||||||
fonts[5] = LoadSpriteFont("resources/fonts/pixantiqua.png");
|
fonts[5] = LoadFont("resources/fonts/pixantiqua.png");
|
||||||
fonts[6] = LoadSpriteFont("resources/fonts/alpha_beta.png");
|
fonts[6] = LoadFont("resources/fonts/alpha_beta.png");
|
||||||
fonts[7] = LoadSpriteFont("resources/fonts/jupiter_crash.png");
|
fonts[7] = LoadFont("resources/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",
|
||||||
|
|
@ -93,8 +93,8 @@ int main()
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// SpriteFonts unloading
|
// Fonts unloading
|
||||||
for (int i = 0; i < MAX_FONTS; i++) UnloadSpriteFont(fonts[i]);
|
for (int i = 0; i < MAX_FONTS; i++) UnloadFont(fonts[i]);
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [text] example - SpriteFont loading and usage
|
* raylib [text] example - Font loading and usage
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* This example has been created using raylib 1.0 (www.raylib.com)
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
|
@ -25,9 +25,9 @@ int main()
|
||||||
const char msg3[50] = "...and a THIRD one! GREAT! :D";
|
const char msg3[50] = "...and a THIRD one! GREAT! :D";
|
||||||
|
|
||||||
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
||||||
SpriteFont font1 = LoadSpriteFont("resources/custom_mecha.png"); // SpriteFont loading
|
Font font1 = LoadFont("resources/custom_mecha.png"); // Font loading
|
||||||
SpriteFont font2 = LoadSpriteFont("resources/custom_alagard.png"); // SpriteFont loading
|
Font font2 = LoadFont("resources/custom_alagard.png"); // Font loading
|
||||||
SpriteFont font3 = LoadSpriteFont("resources/custom_jupiter_crash.png"); // SpriteFont loading
|
Font font3 = LoadFont("resources/custom_jupiter_crash.png"); // Font loading
|
||||||
|
|
||||||
Vector2 fontPosition1, fontPosition2, fontPosition3;
|
Vector2 fontPosition1, fontPosition2, fontPosition3;
|
||||||
|
|
||||||
|
|
@ -66,9 +66,9 @@ int main()
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadSpriteFont(font1); // SpriteFont unloading
|
UnloadFont(font1); // Font unloading
|
||||||
UnloadSpriteFont(font2); // SpriteFont unloading
|
UnloadFont(font2); // Font unloading
|
||||||
UnloadSpriteFont(font3); // SpriteFont unloading
|
UnloadFont(font3); // Font unloading
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,12 @@ int main()
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [text] example - ttf loading");
|
InitWindow(screenWidth, screenHeight, "raylib [text] example - ttf loading");
|
||||||
|
|
||||||
const char msg[50] = "TTF SpriteFont";
|
const char msg[50] = "TTF Font";
|
||||||
|
|
||||||
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
||||||
|
|
||||||
// TTF SpriteFont loading with custom generation parameters
|
// TTF Font loading with custom generation parameters
|
||||||
SpriteFont font = LoadSpriteFontEx("resources/KAISG.ttf", 96, 0, 0);
|
Font font = LoadFontEx("resources/KAISG.ttf", 96, 0, 0);
|
||||||
|
|
||||||
// Generate mipmap levels to use trilinear filtering
|
// Generate mipmap levels to use trilinear filtering
|
||||||
// NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
|
// NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
|
||||||
|
|
@ -85,8 +85,8 @@ int main()
|
||||||
|
|
||||||
if (count == 1) // Only support one ttf file dropped
|
if (count == 1) // Only support one ttf file dropped
|
||||||
{
|
{
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
font = LoadSpriteFontEx(droppedFiles[0], fontSize, 0, 0);
|
font = LoadFontEx(droppedFiles[0], fontSize, 0, 0);
|
||||||
ClearDroppedFiles();
|
ClearDroppedFiles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -127,7 +127,7 @@ int main()
|
||||||
#if defined(PLATFORM_DESKTOP)
|
#if defined(PLATFORM_DESKTOP)
|
||||||
ClearDroppedFiles(); // Clear internal buffers
|
ClearDroppedFiles(); // Clear internal buffers
|
||||||
#endif
|
#endif
|
||||||
UnloadSpriteFont(font); // SpriteFont unloading
|
UnloadFont(font); // Font unloading
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,12 @@ int main()
|
||||||
UnloadImage(cat); // Unload image from RAM
|
UnloadImage(cat); // Unload image from RAM
|
||||||
|
|
||||||
// Load custom font for frawing on image
|
// Load custom font for frawing on image
|
||||||
SpriteFont font = LoadSpriteFont("resources/custom_jupiter_crash.png");
|
Font font = LoadFont("resources/custom_jupiter_crash.png");
|
||||||
|
|
||||||
// Draw over image using custom font
|
// Draw over image using custom font
|
||||||
ImageDrawTextEx(&parrots, (Vector2){ 300, 230 }, font, "PARROTS & CAT", font.baseSize, -2, WHITE);
|
ImageDrawTextEx(&parrots, (Vector2){ 300, 230 }, font, "PARROTS & CAT", font.baseSize, -2, WHITE);
|
||||||
|
|
||||||
UnloadSpriteFont(font); // Unload custom spritefont (already drawn used on image)
|
UnloadFont(font); // Unload custom spritefont (already drawn used on image)
|
||||||
|
|
||||||
Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM)
|
Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM)
|
||||||
UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
|
UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ int main()
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [texture] example - image text drawing");
|
InitWindow(screenWidth, screenHeight, "raylib [texture] example - image text drawing");
|
||||||
|
|
||||||
// TTF SpriteFont loading with custom generation parameters
|
// TTF Font loading with custom generation parameters
|
||||||
SpriteFont font = LoadSpriteFontEx("resources/KAISG.ttf", 64, 0, 0);
|
Font font = LoadFontEx("resources/KAISG.ttf", 64, 0, 0);
|
||||||
|
|
||||||
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
|
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
|
||||||
|
|
||||||
|
|
@ -74,7 +74,7 @@ int main()
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadTexture(texture); // Texture unloading
|
UnloadTexture(texture); // Texture unloading
|
||||||
|
|
||||||
UnloadSpriteFont(font); // Unload custom spritefont
|
UnloadFont(font); // Unload custom spritefont
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ int main()
|
||||||
Texture2D gframe = LoadTexture("resources/gframe.png");
|
Texture2D gframe = LoadTexture("resources/gframe.png");
|
||||||
|
|
||||||
// Load game resources: fonts
|
// Load game resources: fonts
|
||||||
SpriteFont font = LoadSpriteFont("resources/komika.png");
|
Font font = LoadFont("resources/komika.png");
|
||||||
|
|
||||||
// Define scrolling variables
|
// Define scrolling variables
|
||||||
int backScrolling = 0;
|
int backScrolling = 0;
|
||||||
|
|
@ -438,7 +438,7 @@ int main()
|
||||||
UnloadTexture(gamera);
|
UnloadTexture(gamera);
|
||||||
|
|
||||||
// Unload font texture
|
// Unload font texture
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ int main()
|
||||||
Texture2D gframe = LoadTexture("resources/gframe.png");
|
Texture2D gframe = LoadTexture("resources/gframe.png");
|
||||||
|
|
||||||
// Load game resources: fonts
|
// Load game resources: fonts
|
||||||
SpriteFont font = LoadSpriteFont("resources/komika.png");
|
Font font = LoadFont("resources/komika.png");
|
||||||
|
|
||||||
// Load game resources: sounds
|
// Load game resources: sounds
|
||||||
Sound eat = LoadSound("resources/eat.wav");
|
Sound eat = LoadSound("resources/eat.wav");
|
||||||
|
|
@ -454,7 +454,7 @@ int main()
|
||||||
UnloadTexture(gamera);
|
UnloadTexture(gamera);
|
||||||
|
|
||||||
// Unload font texture
|
// Unload font texture
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
|
|
||||||
// Unload sounds
|
// Unload sounds
|
||||||
UnloadSound(eat);
|
UnloadSound(eat);
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ int main()
|
||||||
Texture2D gframe = LoadTexture("resources/gframe.png");
|
Texture2D gframe = LoadTexture("resources/gframe.png");
|
||||||
|
|
||||||
// Load game resources: fonts
|
// Load game resources: fonts
|
||||||
SpriteFont font = LoadSpriteFont("resources/komika.png");
|
Font font = LoadFont("resources/komika.png");
|
||||||
|
|
||||||
// Load game resources: sounds
|
// Load game resources: sounds
|
||||||
Sound eat = LoadSound("resources/eat.wav");
|
Sound eat = LoadSound("resources/eat.wav");
|
||||||
|
|
@ -479,7 +479,7 @@ int main()
|
||||||
UnloadTexture(gamera);
|
UnloadTexture(gamera);
|
||||||
|
|
||||||
// Unload font texture
|
// Unload font texture
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
|
|
||||||
// Unload sounds
|
// Unload sounds
|
||||||
UnloadSound(eat);
|
UnloadSound(eat);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ Texture2D swhale;
|
||||||
Texture2D fish;
|
Texture2D fish;
|
||||||
Texture2D gframe;
|
Texture2D gframe;
|
||||||
|
|
||||||
SpriteFont font;
|
Font font;
|
||||||
|
|
||||||
Sound eat;
|
Sound eat;
|
||||||
Sound die;
|
Sound die;
|
||||||
|
|
@ -119,7 +119,7 @@ int main()
|
||||||
gframe = LoadTexture("resources/gframe.png");
|
gframe = LoadTexture("resources/gframe.png");
|
||||||
|
|
||||||
// Load game resources: fonts
|
// Load game resources: fonts
|
||||||
font = LoadSpriteFont("resources/komika.png");
|
font = LoadFont("resources/komika.png");
|
||||||
|
|
||||||
// Load game resources: sounds
|
// Load game resources: sounds
|
||||||
eat = LoadSound("resources/eat.wav");
|
eat = LoadSound("resources/eat.wav");
|
||||||
|
|
@ -186,7 +186,7 @@ int main()
|
||||||
UnloadTexture(gamera);
|
UnloadTexture(gamera);
|
||||||
|
|
||||||
// Unload font texture
|
// Unload font texture
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
|
|
||||||
// Unload sounds
|
// Unload sounds
|
||||||
UnloadSound(eat);
|
UnloadSound(eat);
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ int main(void) {
|
||||||
InitWindow(screenWidth, screenHeight, windowTitle);
|
InitWindow(screenWidth, screenHeight, windowTitle);
|
||||||
|
|
||||||
// Load global data here (assets that must be available in all screens, i.e. fonts)
|
// Load global data here (assets that must be available in all screens, i.e. fonts)
|
||||||
font = LoadSpriteFont("resources/graphics/mainfont.png");
|
font = LoadFont("resources/graphics/mainfont.png");
|
||||||
|
|
||||||
atlas01 = LoadTexture("resources/graphics/atlas01.png");
|
atlas01 = LoadTexture("resources/graphics/atlas01.png");
|
||||||
atlas02 = LoadTexture("resources/graphics/atlas02.png");
|
atlas02 = LoadTexture("resources/graphics/atlas02.png");
|
||||||
|
|
@ -114,7 +114,7 @@ int main(void) {
|
||||||
|
|
||||||
UnloadTexture(atlas01);
|
UnloadTexture(atlas01);
|
||||||
UnloadTexture(atlas02);
|
UnloadTexture(atlas02);
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
|
|
||||||
UnloadShader(colorBlend); // Unload color overlay blending shader
|
UnloadShader(colorBlend); // Unload color overlay blending shader
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ typedef enum GameScreen { LOGO, TITLE, OPTIONS, GAMEPLAY, ENDING } GameScreen;
|
||||||
GameScreen currentScreen;
|
GameScreen currentScreen;
|
||||||
|
|
||||||
// NOTE: This is all the data used in the game
|
// NOTE: This is all the data used in the game
|
||||||
SpriteFont font;
|
Font font;
|
||||||
Shader colorBlend;
|
Shader colorBlend;
|
||||||
Texture2D atlas01;
|
Texture2D atlas01;
|
||||||
Texture2D atlas02;
|
Texture2D atlas02;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ int main(void)
|
||||||
|
|
||||||
UnloadImage(image); // Unload image from CPU memory (RAM)
|
UnloadImage(image); // Unload image from CPU memory (RAM)
|
||||||
|
|
||||||
font = LoadSpriteFont("resources/font_arcadian.png");
|
font = LoadFont("resources/font_arcadian.png");
|
||||||
//doors = LoadTexture("resources/textures/doors.png");
|
//doors = LoadTexture("resources/textures/doors.png");
|
||||||
//sndDoor = LoadSound("resources/audio/door.ogg");
|
//sndDoor = LoadSound("resources/audio/door.ogg");
|
||||||
|
|
||||||
|
|
@ -106,7 +106,7 @@ int main(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unload all global loaded data (i.e. fonts) here!
|
// Unload all global loaded data (i.e. fonts) here!
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
//UnloadSound(sndDoor);
|
//UnloadSound(sndDoor);
|
||||||
|
|
||||||
UnloadMusicStream(music);
|
UnloadMusicStream(music);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ typedef enum GameScreen { LOGO_RL = 0, TITLE, GAMEPLAY } GameScreen;
|
||||||
// Global Variables Definition
|
// Global Variables Definition
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
GameScreen currentScreen;
|
GameScreen currentScreen;
|
||||||
SpriteFont font;
|
Font font;
|
||||||
|
|
||||||
Color *lightsMap;
|
Color *lightsMap;
|
||||||
int lightsMapWidth, lightsMapHeight;
|
int lightsMapWidth, lightsMapHeight;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ typedef struct Door {
|
||||||
// Global Variables Definition
|
// Global Variables Definition
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
GameScreen currentScreen;
|
GameScreen currentScreen;
|
||||||
SpriteFont font;
|
Font font;
|
||||||
|
|
||||||
Texture2D doors;
|
Texture2D doors;
|
||||||
Sound sndDoor;
|
Sound sndDoor;
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ int main(void)
|
||||||
music = LoadMusicStream("resources/audio/come_play_with_me.ogg");
|
music = LoadMusicStream("resources/audio/come_play_with_me.ogg");
|
||||||
PlayMusicStream(music);
|
PlayMusicStream(music);
|
||||||
|
|
||||||
font = LoadSpriteFont("resources/textures/alagard.png");
|
font = LoadFont("resources/textures/alagard.png");
|
||||||
doors = LoadTexture("resources/textures/doors.png");
|
doors = LoadTexture("resources/textures/doors.png");
|
||||||
sndDoor = LoadSound("resources/audio/door.ogg");
|
sndDoor = LoadSound("resources/audio/door.ogg");
|
||||||
sndScream = LoadSound("resources/audio/scream.ogg");
|
sndScream = LoadSound("resources/audio/scream.ogg");
|
||||||
|
|
@ -89,7 +89,7 @@ int main(void)
|
||||||
|
|
||||||
// Unload all global loaded data (i.e. fonts) here!
|
// Unload all global loaded data (i.e. fonts) here!
|
||||||
UnloadPlayer();
|
UnloadPlayer();
|
||||||
UnloadSpriteFont(font);
|
UnloadFont(font);
|
||||||
UnloadTexture(doors);
|
UnloadTexture(doors);
|
||||||
UnloadSound(sndDoor);
|
UnloadSound(sndDoor);
|
||||||
UnloadSound(sndScream);
|
UnloadSound(sndScream);
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ static Mission *missions = NULL;
|
||||||
|
|
||||||
static char headline[MAX_TITLE_CHAR] = "\0";
|
static char headline[MAX_TITLE_CHAR] = "\0";
|
||||||
|
|
||||||
SpriteFont fontNews;
|
Font fontNews;
|
||||||
|
|
||||||
// String (const char *) replacement function
|
// String (const char *) replacement function
|
||||||
static char *StringReplace(char *orig, char *rep, char *with);
|
static char *StringReplace(char *orig, char *rep, char *with);
|
||||||
|
|
@ -121,11 +121,11 @@ void InitEndingScreen(void)
|
||||||
|
|
||||||
// Generate newspaper with title and subtitle
|
// Generate newspaper with title and subtitle
|
||||||
Image imNewspaper = LoadImage("resources/textures/ending_newspaper.png");
|
Image imNewspaper = LoadImage("resources/textures/ending_newspaper.png");
|
||||||
fontNews = LoadSpriteFontEx("resources/fonts/Lora-Bold.ttf", 32, 250, 0);
|
fontNews = LoadFontEx("resources/fonts/Lora-Bold.ttf", 32, 250, 0);
|
||||||
ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 220 }, fontNews, headline, fontNews.baseSize, 0, DARKGRAY);
|
ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 220 }, fontNews, headline, fontNews.baseSize, 0, DARKGRAY);
|
||||||
|
|
||||||
texNewspaper = LoadTextureFromImage(imNewspaper);
|
texNewspaper = LoadTextureFromImage(imNewspaper);
|
||||||
//UnloadSpriteFont(fontNews);
|
//UnloadFont(fontNews);
|
||||||
UnloadImage(imNewspaper);
|
UnloadImage(imNewspaper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ static int framesCounter;
|
||||||
static int finishScreen;
|
static int finishScreen;
|
||||||
|
|
||||||
static Texture2D texBackground;
|
static Texture2D texBackground;
|
||||||
static SpriteFont fontMessage;
|
static Font fontMessage;
|
||||||
static Texture2D texWordsAtlas;
|
static Texture2D texWordsAtlas;
|
||||||
static Texture2D texVignette;
|
static Texture2D texVignette;
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ void InitGameplayScreen(void)
|
||||||
framesCounter = 0;
|
framesCounter = 0;
|
||||||
finishScreen = 0;
|
finishScreen = 0;
|
||||||
|
|
||||||
fontMessage = LoadSpriteFontEx("resources/fonts/traveling_typewriter.ttf", 30, 250, 0);
|
fontMessage = LoadFontEx("resources/fonts/traveling_typewriter.ttf", 30, 250, 0);
|
||||||
|
|
||||||
texBackground = LoadTexture("resources/textures/message_background.png");
|
texBackground = LoadTexture("resources/textures/message_background.png");
|
||||||
texVignette = LoadTexture("resources/textures/message_vignette.png");
|
texVignette = LoadTexture("resources/textures/message_vignette.png");
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ static int framesCounter;
|
||||||
static int finishScreen;
|
static int finishScreen;
|
||||||
|
|
||||||
static Texture2D texBackground;
|
static Texture2D texBackground;
|
||||||
static SpriteFont fontTitle;
|
static Font fontTitle;
|
||||||
static Sound fxTyping;
|
static Sound fxTyping;
|
||||||
|
|
||||||
static float titleSize;
|
static float titleSize;
|
||||||
|
|
@ -71,7 +71,7 @@ void InitTitleScreen(void)
|
||||||
|
|
||||||
texBackground = LoadTexture("resources/textures/title_background.png");
|
texBackground = LoadTexture("resources/textures/title_background.png");
|
||||||
fxTyping = LoadSound("resources/audio/fx_typing.ogg");
|
fxTyping = LoadSound("resources/audio/fx_typing.ogg");
|
||||||
fontTitle = LoadSpriteFontEx("resources/fonts/mom_typewritter.ttf", 96, 0, 0);
|
fontTitle = LoadFontEx("resources/fonts/mom_typewritter.ttf", 96, 0, 0);
|
||||||
|
|
||||||
titleSize = 44;
|
titleSize = 44;
|
||||||
transmissionPosition = (Vector2){519, 221};
|
transmissionPosition = (Vector2){519, 221};
|
||||||
|
|
@ -148,7 +148,7 @@ void UnloadTitleScreen(void)
|
||||||
{
|
{
|
||||||
UnloadTexture(texBackground);
|
UnloadTexture(texBackground);
|
||||||
UnloadSound(fxTyping);
|
UnloadSound(fxTyping);
|
||||||
UnloadSpriteFont(fontTitle);
|
UnloadFont(fontTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Title Screen should finish?
|
// Title Screen should finish?
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue