mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 19:43:22 +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;
|
||||
}
|
||||
|
||||
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);
|
||||
}, 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;
|
||||
|
||||
protected override void Miss(JudgementResult result)
|
||||
|
Loading…
Reference in New Issue
Block a user