mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 18:27:26 +08:00
Moved movement to the default position to property
This commit is contained in:
parent
77bfe57d8c
commit
f166bb0f96
@ -15,7 +15,24 @@ namespace osu.Game.Graphics.Containers
|
||||
class ParallaxContainer : Container
|
||||
{
|
||||
public float ParallaxAmount = 0.02f;
|
||||
public bool ParallaxEnabled = true;
|
||||
|
||||
private bool parallaxEnabled = true;
|
||||
public bool ParallaxEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return parallaxEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
parallaxEnabled = value;
|
||||
if (!parallaxEnabled)
|
||||
{
|
||||
content.MoveTo(Vector2.Zero, 1000, EasingTypes.OutQuint);
|
||||
content.Scale = Vector2.One;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||
|
||||
@ -43,11 +60,6 @@ namespace osu.Game.Graphics.Containers
|
||||
config.GetBindable<bool>(OsuConfig.MenuParallax).ValueChanged += delegate
|
||||
{
|
||||
ParallaxEnabled = config.GetBindable<bool>(OsuConfig.MenuParallax);
|
||||
if (!ParallaxEnabled)
|
||||
{
|
||||
content.MoveTo(Vector2.Zero, 1000, EasingTypes.OutQuint);
|
||||
content.Scale = Vector2.One;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user