Jump to content

Recommended Posts

Posted
  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 ?

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Posted

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

  • Like 1

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Posted

You can also do this:

fadeouttime = Time::GetCurrent() + 3000;

And then this:

float alpha = 1.0f - float(fadeouttime - Time::GetCurrent()) / 3000.0f;

 

Let's build cool stuff and have fun. :)

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...