From a5415b99aecb21ed74f8c9feb048288878325cf2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 20:35:07 +0900 Subject: [PATCH] Visualise the hovered drawabe --- osu.Game.Tests/Visual/TestCaseCursors.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseCursors.cs b/osu.Game.Tests/Visual/TestCaseCursors.cs index e0ce5fad77..20e6103436 100644 --- a/osu.Game.Tests/Visual/TestCaseCursors.cs +++ b/osu.Game.Tests/Visual/TestCaseCursors.cs @@ -5,6 +5,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input; using osu.Framework.MathUtils; using osu.Framework.Testing.Input; using osu.Game.Graphics.Cursor; @@ -198,6 +199,8 @@ namespace osu.Game.Tests.Visual public CursorContainer Cursor { get; } public bool ProvidingUserCursor { get; } + private readonly Box background; + public CustomCursorBox(Color4 cursorColour, bool providesUserCursor = true) { ProvidingUserCursor = providesUserCursor; @@ -207,7 +210,7 @@ namespace osu.Game.Tests.Visual Children = new Drawable[] { - new Box + background = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.1f @@ -224,6 +227,18 @@ namespace osu.Game.Tests.Visual } }; } + + protected override bool OnHover(InputState state) + { + background.FadeTo(0.4f, 250, Easing.OutQuint); + return false; + } + + protected override void OnHoverLost(InputState state) + { + background.FadeTo(0.1f, 250); + base.OnHoverLost(state); + } } private class TestCursorContainer : CursorContainer