mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 18:37:27 +08:00
33 lines
813 B
C#
33 lines
813 B
C#
|
|
|||
|
using OpenTK.Graphics;
|
|||
|
using osu.Framework.Allocation;
|
|||
|
using osu.Framework.Graphics;
|
|||
|
using osu.Framework.Input;
|
|||
|
|
|||
|
namespace osu.Game.Graphics.Containers
|
|||
|
{
|
|||
|
|
|||
|
public class OsuHoverContainer : OsuClickableContainer
|
|||
|
{
|
|||
|
private Color4 hoverColour;
|
|||
|
|
|||
|
protected override bool OnHover(InputState state)
|
|||
|
{
|
|||
|
this.FadeColour(hoverColour, 500, Easing.OutQuint);
|
|||
|
return base.OnHover(state);
|
|||
|
}
|
|||
|
|
|||
|
protected override void OnHoverLost(InputState state)
|
|||
|
{
|
|||
|
this.FadeColour(Color4.White, 500, Easing.OutQuint);
|
|||
|
base.OnHoverLost(state);
|
|||
|
}
|
|||
|
|
|||
|
[BackgroundDependencyLoader]
|
|||
|
private void load(OsuColour colours)
|
|||
|
{
|
|||
|
hoverColour = colours.Yellow;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|