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
|
@ -38,12 +38,12 @@ int main()
|
|||
UnloadImage(cat); // Unload image from RAM
|
||||
|
||||
// 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
|
||||
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)
|
||||
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");
|
||||
|
||||
// TTF SpriteFont loading with custom generation parameters
|
||||
SpriteFont font = LoadSpriteFontEx("resources/KAISG.ttf", 64, 0, 0);
|
||||
// TTF Font loading with custom generation parameters
|
||||
Font font = LoadFontEx("resources/KAISG.ttf", 64, 0, 0);
|
||||
|
||||
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
|
||||
|
||||
|
@ -74,7 +74,7 @@ int main()
|
|||
//--------------------------------------------------------------------------------------
|
||||
UnloadTexture(texture); // Texture unloading
|
||||
|
||||
UnloadSpriteFont(font); // Unload custom spritefont
|
||||
UnloadFont(font); // Unload custom spritefont
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue