mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 16:42:57 +08:00
Make parallax container work with global mouse state (so it ignores bounds checks).
This commit is contained in:
parent
bb0424f83f
commit
9938084343
@ -25,18 +25,20 @@ namespace osu.Game.Graphics.Containers
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Container content;
|
private Container content;
|
||||||
|
private InputManager input;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
protected override bool OnMouseMove(InputState state)
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(UserInputManager input)
|
||||||
{
|
{
|
||||||
content.Position = (state.Mouse.Position - DrawSize / 2) * ParallaxAmount;
|
this.input = input;
|
||||||
return base.OnMouseMove(state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
content.Position = (input.CurrentState.Mouse.Position - DrawSize / 2) * ParallaxAmount;
|
||||||
content.Scale = new Vector2(1 + ParallaxAmount);
|
content.Scale = new Vector2(1 + ParallaxAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user