From 3e7defc05a750871af3f68c45c101687402498b9 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 25 Jul 2023 16:25:21 +0200 Subject: [PATCH] Update controls_test_suite.c --- .../controls_test_suite/controls_test_suite.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/controls_test_suite/controls_test_suite.c b/examples/controls_test_suite/controls_test_suite.c index 79f7d1e..21ed5cc 100644 --- a/examples/controls_test_suite/controls_test_suite.c +++ b/examples/controls_test_suite/controls_test_suite.c @@ -120,6 +120,8 @@ int main() char textInputFileName[256] = { 0 }; + float alpha = 1.0f; + SetTargetFPS(60); //-------------------------------------------------------------------------------------- @@ -143,9 +145,17 @@ int main() UnloadDroppedFiles(droppedFiles); // Clear internal buffers } - progressValue += 0.002f; - //if (progressValue >= 1.0f) progressValue = 0.0f; - if (IsKeyPressed(KEY_SPACE)) progressValue = 0.2f; + //alpha -= 0.002f; + if (alpha < 0.0f) alpha = 0.0f; + if (IsKeyPressed(KEY_SPACE)) alpha = 1.0f; + + GuiSetAlpha(alpha); + + //progressValue += 0.002f; + if (IsKeyPressed(KEY_LEFT)) progressValue -= 0.1f; + else if (IsKeyPressed(KEY_RIGHT)) progressValue += 0.1f; + if (progressValue > 1.0f) progressValue = 1.0f; + else if (progressValue < 0.0f) progressValue = 0.0f; if (visualStyleActive != prevVisualStyleActive) {