mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Visualise the hovered drawabe
This commit is contained in:
parent
1174f34489
commit
a5415b99ae
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user