mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add a new test for OsuScreenStack, fix parallax
This commit is contained in:
@ -15,6 +15,8 @@ namespace osu.Game.Screens
|
||||
|
||||
private ParallaxContainer parallaxContainer;
|
||||
|
||||
protected float ParallaxAmount => parallaxContainer.ParallaxAmount;
|
||||
|
||||
public OsuScreenStack()
|
||||
{
|
||||
initializeStack();
|
||||
@ -35,11 +37,15 @@ namespace osu.Game.Screens
|
||||
};
|
||||
|
||||
ScreenPushed += setParallax;
|
||||
ScreenExited += setParallax;
|
||||
}
|
||||
|
||||
private void setParallax(IScreen prev, IScreen next)
|
||||
{
|
||||
parallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * ((IOsuScreen)next).BackgroundParallaxAmount;
|
||||
if (next != null)
|
||||
{
|
||||
parallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * ((IOsuScreen)next).BackgroundParallaxAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user