mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Use interpolation for health bar opacity instead of transforms
This commit is contained in:
parent
8d389accf8
commit
7825bea959
@ -131,15 +131,18 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
resetMissBarDelegate = null;
|
resetMissBarDelegate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v.NewValue == 0)
|
|
||||||
healthBar.FadeOut(300, Easing.OutQuint);
|
|
||||||
else if (healthBar.Alpha < 1)
|
|
||||||
healthBar.FadeIn(300, Easing.OutQuint);
|
|
||||||
|
|
||||||
this.TransformTo(nameof(HealthBarValue), v.NewValue, 300, Easing.OutQuint);
|
this.TransformTo(nameof(HealthBarValue), v.NewValue, 300, Easing.OutQuint);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
float targetAlpha = Current.Value > 0 ? 1 : 0;
|
||||||
|
healthBar.Alpha = (float)Interpolation.DampContinuously(healthBar.Alpha, targetAlpha, 50.0, Time.Elapsed);
|
||||||
|
}
|
||||||
|
|
||||||
private ScheduledDelegate? resetMissBarDelegate;
|
private ScheduledDelegate? resetMissBarDelegate;
|
||||||
|
|
||||||
protected override void Miss(JudgementResult result)
|
protected override void Miss(JudgementResult result)
|
||||||
|
Loading…
Reference in New Issue
Block a user