2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-06-21 11:48:57 +08:00
|
|
|
|
|
2019-02-15 16:01:06 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Screens;
|
2018-06-21 11:48:57 +08:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osu.Game.Screens.Backgrounds;
|
|
|
|
|
|
2019-03-25 00:02:36 +08:00
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
2018-06-21 11:48:57 +08:00
|
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public class TestSceneParallaxContainer : OsuTestScene
|
2018-06-21 11:48:57 +08:00
|
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public TestSceneParallaxContainer()
|
2018-06-21 11:48:57 +08:00
|
|
|
|
{
|
|
|
|
|
ParallaxContainer parallax;
|
|
|
|
|
|
|
|
|
|
Add(parallax = new ParallaxContainer
|
|
|
|
|
{
|
2019-02-15 16:01:06 +08:00
|
|
|
|
Child = new ScreenStack(new BackgroundScreenDefault { Alpha = 0.8f })
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
}
|
2018-06-21 11:48:57 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AddStep("default parallax", () => parallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT);
|
|
|
|
|
AddStep("high parallax", () => parallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * 10);
|
|
|
|
|
AddStep("no parallax", () => parallax.ParallaxAmount = 0);
|
|
|
|
|
AddStep("negative parallax", () => parallax.ParallaxAmount = -ParallaxContainer.DEFAULT_PARALLAX_AMOUNT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|