mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 17:52:56 +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 InputManager input;
|
||||
|
||||
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;
|
||||
return base.OnMouseMove(state);
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
content.Position = (input.CurrentState.Mouse.Position - DrawSize / 2) * ParallaxAmount;
|
||||
content.Scale = new Vector2(1 + ParallaxAmount);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user