mirror of https://github.com/ppy/osu
Flash buttons on click.
This commit is contained in:
parent
e40ad69a3b
commit
e1e9772d46
|
@ -423,6 +423,7 @@ public FontAwesome Icon
|
||||||
}
|
}
|
||||||
|
|
||||||
private const float button_size = 30;
|
private const float button_size = 30;
|
||||||
|
private Color4 flashColour;
|
||||||
|
|
||||||
public Vector2 IconScale
|
public Vector2 IconScale
|
||||||
{
|
{
|
||||||
|
@ -475,6 +476,7 @@ public Button()
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
hover.Colour = colours.Yellow.Opacity(0.6f);
|
hover.Colour = colours.Yellow.Opacity(0.6f);
|
||||||
|
flashColour = colours.Yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
|
@ -489,6 +491,12 @@ protected override void OnHoverLost(InputState state)
|
||||||
base.OnHoverLost(state);
|
base.OnHoverLost(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnClick(InputState state)
|
||||||
|
{
|
||||||
|
hover.FlashColour(flashColour, 800, EasingTypes.OutQuint);
|
||||||
|
return base.OnClick(state);
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||||
{
|
{
|
||||||
content.ScaleTo(0.75f, 2000, EasingTypes.OutQuint);
|
content.ScaleTo(0.75f, 2000, EasingTypes.OutQuint);
|
||||||
|
|
Loading…
Reference in New Issue