mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 17:42:54 +08:00
962e4d7c8a
Also reimplemented the OsuHoverContainer properly
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
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;
|
|
private Color4 unhoverColour;
|
|
|
|
protected override bool OnHover(InputState state)
|
|
{
|
|
this.FadeColour(hoverColour, 500, Easing.OutQuint);
|
|
return base.OnHover(state);
|
|
}
|
|
|
|
protected override void OnHoverLost(InputState state)
|
|
{
|
|
this.FadeColour(unhoverColour, 500, Easing.OutQuint);
|
|
base.OnHoverLost(state);
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OsuColour colours)
|
|
{
|
|
hoverColour = colours.Yellow;
|
|
unhoverColour = Colour;
|
|
}
|
|
}
|
|
}
|