diff options
| author | Ray San <[email protected]> | 2017-10-17 11:51:50 +0200 |
|---|---|---|
| committer | Ray San <[email protected]> | 2017-10-17 11:51:50 +0200 |
| commit | 5dc216f4196603a9b5951b596ac2b9b0e84d56e3 (patch) | |
| tree | 25da3d9671843713029e5c2de4d50e390ff964fa /examples/textures/textures_image_drawing.c | |
| parent | b065edc8785a5a7aca3dfe79163b15aa7a0d6883 (diff) | |
| download | raylib-5dc216f4196603a9b5951b596ac2b9b0e84d56e3.tar.gz raylib-5dc216f4196603a9b5951b596ac2b9b0e84d56e3.zip | |
Improved some examples
Diffstat (limited to 'examples/textures/textures_image_drawing.c')
| -rw-r--r-- | examples/textures/textures_image_drawing.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/textures/textures_image_drawing.c b/examples/textures/textures_image_drawing.c index 1c6a1fb9..ac128af9 100644 --- a/examples/textures/textures_image_drawing.c +++ b/examples/textures/textures_image_drawing.c @@ -36,6 +36,14 @@ int main() ImageCrop(&parrots, (Rectangle){ 0, 50, parrots.width, parrots.height - 100 }); // Crop resulting image UnloadImage(cat); // Unload image from RAM + + // Load custom font for frawing on image + SpriteFont font = LoadSpriteFont("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) 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 |
