mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Add glow to focused meter
This commit is contained in:
@ -38,6 +38,8 @@ namespace osu.Game.Overlays.Volume
|
|||||||
private OsuSpriteText text;
|
private OsuSpriteText text;
|
||||||
private BufferedContainer maxGlow;
|
private BufferedContainer maxGlow;
|
||||||
|
|
||||||
|
private Container focusGlowContainer;
|
||||||
|
|
||||||
private Sample sample;
|
private Sample sample;
|
||||||
private double sampleLastPlaybackTime;
|
private double sampleLastPlaybackTime;
|
||||||
|
|
||||||
@ -75,6 +77,25 @@ namespace osu.Game.Overlays.Volume
|
|||||||
Size = new Vector2(circleSize),
|
Size = new Vector2(circleSize),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
focusGlowContainer = new CircularContainer
|
||||||
|
{
|
||||||
|
Masking = true,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0,
|
||||||
|
Child = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0,
|
||||||
|
AlwaysPresent = true,
|
||||||
|
},
|
||||||
|
EdgeEffect = new EdgeEffectParameters
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Colour = meterColour.Opacity(0.5f),
|
||||||
|
Radius = 5,
|
||||||
|
Hollow = true,
|
||||||
|
}
|
||||||
|
},
|
||||||
new BufferedContainer
|
new BufferedContainer
|
||||||
{
|
{
|
||||||
Alpha = 0.9f,
|
Alpha = 0.9f,
|
||||||
@ -312,11 +333,13 @@ namespace osu.Game.Overlays.Volume
|
|||||||
public void Focus()
|
public void Focus()
|
||||||
{
|
{
|
||||||
this.ScaleTo(1.04f, transition_length, Easing.OutExpo);
|
this.ScaleTo(1.04f, transition_length, Easing.OutExpo);
|
||||||
|
focusGlowContainer.FadeIn(transition_length, Easing.OutExpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unfocus()
|
public void Unfocus()
|
||||||
{
|
{
|
||||||
this.ScaleTo(1f, transition_length, Easing.OutExpo);
|
this.ScaleTo(1f, transition_length, Easing.OutExpo);
|
||||||
|
focusGlowContainer.FadeOut(transition_length, Easing.OutExpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
Reference in New Issue
Block a user