Jump to content

fade question


aiaf
 Share

Recommended Posts

  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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

You can also do this:

fadeouttime = Time::GetCurrent() + 3000;

And then this:

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

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...