mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:02:54 +08:00
Create properties for use in DrawableManiaJudgement
This commit is contained in:
parent
272ebeb23d
commit
12f334035f
@ -22,22 +22,20 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
JudgementText.Font = JudgementText.Font.With(size: 25);
|
JudgementText.Font = JudgementText.Font.With(size: 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override double FadeInDuration => 50;
|
||||||
|
|
||||||
|
protected override float InitialHitScale => 0.8f;
|
||||||
|
|
||||||
|
protected override double HitFadeOutDuration => 200;
|
||||||
|
|
||||||
|
protected override float HitScaleDuration => 250;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
|
||||||
|
|
||||||
this.FadeInFromZero(50, Easing.OutQuint);
|
|
||||||
|
|
||||||
if (Result.IsHit)
|
if (Result.IsHit)
|
||||||
{
|
JudgementBody.Delay(FadeInDuration).ScaleTo(0.75f, HitScaleDuration);
|
||||||
JudgementBody.ScaleTo(0.8f);
|
|
||||||
JudgementBody.ScaleTo(1, 250, Easing.OutElastic);
|
|
||||||
|
|
||||||
JudgementBody.Delay(50).ScaleTo(0.75f, 250);
|
base.LoadComplete();
|
||||||
this.Delay(50).FadeOut(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
Expire();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,14 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
protected Container JudgementBody;
|
protected Container JudgementBody;
|
||||||
protected SpriteText JudgementText;
|
protected SpriteText JudgementText;
|
||||||
|
|
||||||
|
protected virtual double FadeInDuration => 100;
|
||||||
|
|
||||||
|
protected virtual float InitialHitScale => 0.9f;
|
||||||
|
|
||||||
|
protected virtual float HitScaleDuration => 500;
|
||||||
|
|
||||||
|
protected virtual double HitFadeOutDuration => 400;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a drawable which visualises a <see cref="Judgements.Judgement"/>.
|
/// Creates a drawable which visualises a <see cref="Judgements.Judgement"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -65,11 +73,13 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private const double MISS_ANIMATION_DURATION = 800;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
this.FadeInFromZero(100, Easing.OutQuint);
|
this.FadeInFromZero(FadeInDuration, Easing.OutQuint);
|
||||||
|
|
||||||
switch (Result.Type)
|
switch (Result.Type)
|
||||||
{
|
{
|
||||||
@ -77,18 +87,18 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
break;
|
break;
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
JudgementBody.ScaleTo(1.6f);
|
JudgementBody.ScaleTo(1.6f);
|
||||||
JudgementBody.ScaleTo(1, 100, Easing.In);
|
JudgementBody.ScaleTo(1, FadeInDuration, Easing.In);
|
||||||
|
|
||||||
JudgementBody.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
|
JudgementBody.MoveToOffset(new Vector2(0, 100), MISS_ANIMATION_DURATION, Easing.InQuint);
|
||||||
JudgementBody.RotateTo(40, 800, Easing.InQuint);
|
JudgementBody.RotateTo(40, MISS_ANIMATION_DURATION, Easing.InQuint);
|
||||||
|
|
||||||
this.Delay(600).FadeOut(200);
|
this.Delay(500).FadeOut(200);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
JudgementBody.ScaleTo(0.9f);
|
JudgementBody.ScaleTo(InitialHitScale);
|
||||||
JudgementBody.ScaleTo(1, 500, Easing.OutElastic);
|
JudgementBody.ScaleTo(1, HitScaleDuration, Easing.OutElastic);
|
||||||
|
|
||||||
this.Delay(100).FadeOut(400);
|
this.Delay(FadeInDuration).FadeOut(HitFadeOutDuration);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user