1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-26 15:32:56 +08:00
osu-lazer/osu.Game/Screens/Ranking/Expanded/TotalScoreCounter.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.5 KiB
C#
Raw Normal View History

2020-03-17 16:25:24 +08:00
// 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;
2021-07-24 04:37:08 +08:00
using osu.Framework.Localisation;
2020-03-17 16:25:24 +08:00
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
2020-03-17 16:25:24 +08:00
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Ranking.Expanded.Accuracy;
using osuTK;
namespace osu.Game.Screens.Ranking.Expanded
{
2020-03-17 16:34:16 +08:00
/// <summary>
/// A counter for the player's total score to be displayed in the <see cref="ExpandedPanelMiddleContent"/>.
/// </summary>
2020-03-17 16:25:24 +08:00
public class TotalScoreCounter : RollingCounter<long>
{
protected override double RollingDuration => AccuracyCircle.ACCURACY_TRANSFORM_DURATION;
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
public TotalScoreCounter()
{
// Todo: AutoSize X removed here due to https://github.com/ppy/osu-framework/issues/3369
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
}
2021-07-24 04:37:08 +08:00
protected override LocalisableString FormatCount(long count) => count.ToString("N0");
2020-03-17 16:25:24 +08:00
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
{
s.Anchor = Anchor.TopCentre;
s.Origin = Anchor.TopCentre;
s.Font = OsuFont.Torus.With(size: 60, weight: FontWeight.Light, fixedWidth: true);
s.Spacing = new Vector2(-5, 0);
});
2020-03-17 16:25:24 +08:00
}
}