mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 18:04:09 +03:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user