From 895f9613d21ecab734ddddec7159dc5e80d92d31 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 28 Jul 2019 15:26:22 +0200 Subject: [PATCH] Added image saved message --- examples/textures/textures_mouse_painting.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/examples/textures/textures_mouse_painting.c b/examples/textures/textures_mouse_painting.c index 24bcce68..55c698c9 100644 --- a/examples/textures/textures_mouse_painting.c +++ b/examples/textures/textures_mouse_painting.c @@ -48,6 +48,8 @@ int main(void) Rectangle btnSaveRec = { 750, 10, 40, 30 }; bool btnSaveMouseHover = false; + bool showSaveMessage = false; + int saveMessageCounter = 0; // Create a RenderTexture2D to use as a canvas RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight); @@ -138,6 +140,17 @@ int main(void) ImageFlipVertical(&image); ExportImage(image, "my_amazing_texture_painting.png"); UnloadImage(image); + showSaveMessage = true; + } + + if (showSaveMessage) + { + saveMessageCounter++; + if (saveMessageCounter > 240) + { + showSaveMessage = false; + saveMessageCounter = 0; + } } //---------------------------------------------------------------------------------- @@ -174,6 +187,13 @@ int main(void) DrawRectangleLinesEx(btnSaveRec, 2, btnSaveMouseHover? RED : BLACK); DrawText("SAVE!", 755, 20, 10, btnSaveMouseHover? RED : BLACK); + if (showSaveMessage) + { + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f)); + DrawRectangle(0, 150, GetScreenWidth(), 80, BLACK); + DrawText("IMAGE SAVED: my_amazing_texture_painting.png", 150, 180, 20, RAYWHITE); + } + EndDrawing(); //---------------------------------------------------------------------------------- }