mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Add stable-like animation legacy rank display
Just substituting the sprite felt pretty terrible.
This commit is contained in:
parent
199d31c0f4
commit
72890bb9ac
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
{
|
{
|
||||||
@ -25,12 +26,38 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
AddInternal(rank = new Sprite());
|
AddInternal(rank = new Sprite
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
scoreProcessor.Rank.BindValueChanged(v => rank.Texture = source.GetTexture($"ranking-{v.NewValue}-small"), true);
|
scoreProcessor.Rank.BindValueChanged(v =>
|
||||||
|
{
|
||||||
|
var texture = source.GetTexture($"ranking-{v.NewValue}-small");
|
||||||
|
|
||||||
|
rank.Texture = texture;
|
||||||
|
|
||||||
|
if (texture != null)
|
||||||
|
{
|
||||||
|
var transientRank = new Sprite
|
||||||
|
{
|
||||||
|
Texture = texture,
|
||||||
|
Blending = BlendingParameters.Additive,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
BypassAutoSizeAxes = Axes.Both,
|
||||||
|
};
|
||||||
|
AddInternal(transientRank);
|
||||||
|
transientRank.FadeOutFromOne(1200, Easing.Out)
|
||||||
|
.ScaleTo(new Vector2(1.625f), 1200, Easing.Out)
|
||||||
|
.Expire();
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
FinishTransforms(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user