1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-28 04:23:06 +08:00
osu-lazer/osu.Game/Screens/Play/Break/RemainingTimeCounter.cs

32 lines
912 B
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.
2018-04-13 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
2018-04-13 17:19:50 +08:00
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
2018-04-13 17:19:50 +08:00
using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Play.Break
{
public class RemainingTimeCounter : Counter
{
private readonly OsuSpriteText counter;
public RemainingTimeCounter()
{
AutoSizeAxes = Axes.Both;
InternalChild = counter = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.Numeric.With(size: 33),
2018-04-13 17:19:50 +08:00
};
}
protected override void OnCountChanged(double count) => counter.Text = ((int)Math.Ceiling(count / 1000)).ToString();
}
}