2023-06-22 16:37:25 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-06-25 09:30:43 +00:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
|
|
|
{
|
2022-11-24 05:32:20 +00:00
|
|
|
|
public partial class TestSceneBackButton : OsuTestScene
|
2019-06-25 09:30:43 +00:00
|
|
|
|
{
|
2019-06-25 11:23:43 +00:00
|
|
|
|
public TestSceneBackButton()
|
|
|
|
|
{
|
2019-07-08 07:34:11 +00:00
|
|
|
|
BackButton button;
|
2019-07-30 03:00:04 +00:00
|
|
|
|
BackButton.Receptor receptor = new BackButton.Receptor();
|
2019-07-08 07:34:11 +00:00
|
|
|
|
|
2019-06-25 09:30:43 +00:00
|
|
|
|
Child = new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(300),
|
|
|
|
|
Masking = true,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2019-07-29 09:45:16 +00:00
|
|
|
|
receptor,
|
2019-06-25 09:30:43 +00:00
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = Color4.SlateGray
|
|
|
|
|
},
|
2019-07-29 09:45:16 +00:00
|
|
|
|
button = new BackButton(receptor)
|
2019-06-25 09:30:43 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
2019-06-25 11:23:43 +00:00
|
|
|
|
Origin = Anchor.BottomLeft,
|
2019-06-25 09:30:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2019-07-08 07:34:11 +00:00
|
|
|
|
button.Action = () => button.Hide();
|
|
|
|
|
|
2019-06-25 09:30:43 +00:00
|
|
|
|
AddStep("show button", () => button.Show());
|
|
|
|
|
AddStep("hide button", () => button.Hide());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|