Interpolate text box alpha

This makes text boxes fade in and out pretty smoothly.

This requires that the textboxclass::setcol() be in Graphics::drawgui(),
so now it's moved there.

Text box fading is only really noticeable if you're playing in slowmode.
This commit is contained in:
Misa
2020-04-28 21:49:15 -07:00
committed by Ethan Lee
parent 4ba9954eb8
commit c56df48d75
3 changed files with 7 additions and 2 deletions

View File

@@ -609,6 +609,10 @@ void Graphics::drawgui()
//Draw all the textboxes to the screen
for (size_t i = 0; i<textbox.size(); i++)
{
//This routine also updates textbox colors
float tl_lerp = lerp(textbox[i].prev_tl, textbox[i].tl);
textbox[i].setcol(textbox[i].tr * tl_lerp, textbox[i].tg * tl_lerp, textbox[i].tb * tl_lerp);
if (textbox[i].r == 0 && textbox[i].g == 0 && textbox[i].b == 0)
{
if(flipmode)