v1.2.1: fixed fader effects stacking (e.g. when taking damage)
This commit is contained in:
parent
172781f75f
commit
4fc020d6e3
|
@ -310,6 +310,8 @@ public class PixelScene extends Scene {
|
||||||
private boolean light;
|
private boolean light;
|
||||||
|
|
||||||
private float time;
|
private float time;
|
||||||
|
|
||||||
|
private static Fader INSTANCE;
|
||||||
|
|
||||||
public Fader( int color, boolean light ) {
|
public Fader( int color, boolean light ) {
|
||||||
super( uiCamera.width, uiCamera.height, color );
|
super( uiCamera.width, uiCamera.height, color );
|
||||||
|
@ -320,6 +322,11 @@ public class PixelScene extends Scene {
|
||||||
|
|
||||||
alpha( 1f );
|
alpha( 1f );
|
||||||
time = FADE_TIME;
|
time = FADE_TIME;
|
||||||
|
|
||||||
|
if (INSTANCE != null){
|
||||||
|
INSTANCE.killAndErase();
|
||||||
|
}
|
||||||
|
INSTANCE = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -331,6 +338,9 @@ public class PixelScene extends Scene {
|
||||||
alpha( 0f );
|
alpha( 0f );
|
||||||
parent.remove( this );
|
parent.remove( this );
|
||||||
destroy();
|
destroy();
|
||||||
|
if (INSTANCE == this) {
|
||||||
|
INSTANCE = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
alpha( time / FADE_TIME );
|
alpha( time / FADE_TIME );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user