Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions osu.Game/Graphics/Containers/ParallaxContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ public ParallaxContainer()
}

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 = (ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2) * ParallaxAmount;
content.Scale = new Vector2(1 + ParallaxAmount);
}
}
Expand Down