mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Merge pull request #192 from peppy/fix-parallax-outside-bounds
Parallax fixes.
This commit is contained in:
commit
ae07806e43
@ -1 +1 @@
|
|||||||
Subproject commit 1a521bb22cfd2c14f58d4cd60fbbfdb70ea8f87b
|
Subproject commit 71bbc980602829cf7eb0db537ebaa2f9668acda5
|
@ -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 = (ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2) * ParallaxAmount;
|
||||||
content.Scale = new Vector2(1 + ParallaxAmount);
|
content.Scale = new Vector2(1 + ParallaxAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user