fade in/out letterboxes during breaks
This commit is contained in:
parent
915728ec24
commit
fdf936e47b
|
@ -465,7 +465,15 @@ public class Game extends BasicGameState {
|
|||
|
||||
// letterbox effect (black bars on top/bottom)
|
||||
if (beatmap.letterboxInBreaks && breakLength >= 4000) {
|
||||
// let it fade in/out
|
||||
float a = Color.black.a;
|
||||
if (trackPosition - breakTime > breakLength / 2) {
|
||||
Color.black.a = (Math.min(500f, breakTime + breakLength - trackPosition)) / 500f;
|
||||
} else {
|
||||
Color.black.a = Math.min(500, trackPosition - breakTime) / 500f;
|
||||
}
|
||||
g.setColor(Color.black);
|
||||
Color.black.a = a;
|
||||
g.fillRect(0, 0, width, height * 0.125f);
|
||||
g.fillRect(0, height * 0.875f, width, height * 0.125f);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user