mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +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:
@@ -9,6 +9,7 @@ textboxclass::textboxclass()
|
||||
h = 0;
|
||||
lw = 0;
|
||||
tl = 0;
|
||||
prev_tl = 0;
|
||||
tm = 0;
|
||||
timer = 0;
|
||||
}
|
||||
@@ -56,6 +57,7 @@ void textboxclass::setcol(int rr, int gg, int bb)
|
||||
|
||||
void textboxclass::update()
|
||||
{
|
||||
prev_tl = tl;
|
||||
if (tm == 0)
|
||||
{
|
||||
tl += .1f;
|
||||
@@ -64,7 +66,6 @@ void textboxclass::update()
|
||||
tl = 1;
|
||||
tm = 1;
|
||||
}
|
||||
setcol(int(tr * tl), int(tg * tl), int(tb * tl));
|
||||
}
|
||||
else if (tm == 2)
|
||||
{
|
||||
@@ -74,7 +75,6 @@ void textboxclass::update()
|
||||
tl = 0.5;
|
||||
//this textbox will be removed by updatetextboxes() later
|
||||
}
|
||||
setcol(int(tr * tl), int(tg * tl), int(tb * tl));
|
||||
}
|
||||
if (timer > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user