1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-18 07:22:57 +08:00
osu-lazer/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs

59 lines
1.8 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Scoring;
using osuTK;
namespace osu.Game.Rulesets.Judgements
{
public partial class DefaultJudgementPiece : TextJudgementPiece, IAnimatableJudgement
{
2020-11-17 14:43:54 +08:00
public DefaultJudgementPiece(HitResult result)
: base(result)
{
AutoSizeAxes = Axes.Both;
Origin = Anchor.Centre;
2020-11-17 14:43:54 +08:00
}
protected override SpriteText CreateJudgementText() =>
new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.Numeric.With(size: 20),
Scale = new Vector2(0.85f, 1),
};
/// <summary>
/// Plays the default animation for this judgement piece.
/// </summary>
/// <remarks>
/// The base implementation only handles fade (for all result types) and misses.
/// Individual rulesets are recommended to implement their appropriate hit animations.
/// </remarks>
2020-11-17 14:43:54 +08:00
public virtual void PlayAnimation()
{
if (Result.IsMiss())
{
2023-12-20 19:23:19 +08:00
this.ScaleTo(1.6f);
this.ScaleTo(1, 100, Easing.In);
2023-12-20 19:23:19 +08:00
this.MoveTo(Vector2.Zero);
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
2023-12-20 19:23:19 +08:00
this.RotateTo(0);
this.RotateTo(40, 800, Easing.InQuint);
}
this.FadeOutFromOne(800);
}
public Drawable? GetAboveHitObjectsProxiedContent() => null;
}
}