aiaf Posted March 7, 2022 Posted March 7, 2022 context->SetColor(0.0, 0.0, 0.0, alphaInitial); context->DrawRect(0, 0, context->GetWidth(), context->GetHeight()); if (alphaInitial > 0.1) { alphaInitial = alphaInitial - 0.005; } I need another way of doing this fade that is not dependent on machine speed, Want this fade to take 3 seconds no matter the machine is running on. Any idea how to do this ? Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station
reepblue Posted March 7, 2022 Posted March 7, 2022 Multiply by Time::GetSpeed(). Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
aiaf Posted March 7, 2022 Author Posted March 7, 2022 Thanks alphaInitial = alphaInitial - (0.003 * Time::GetSpeed()); I leave it here in case someone need in future. Here are some values of the Time::GetSpeed() on my machine: 1 20.36 11.74 9.59 6.295 4.6775 3.80875 3.43438 3.21719 3.07859 3.0693 3.00465 3.12232 3.21116 3.07558 3.06779 1 Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station
Josh Posted March 13, 2022 Posted March 13, 2022 You can also do this: fadeouttime = Time::GetCurrent() + 3000; And then this: float alpha = 1.0f - float(fadeouttime - Time::GetCurrent()) / 3000.0f; Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.