2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-09-21 03:33:07 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
2018-03-03 23:50:41 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-11-06 13:58:05 +08:00
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2018-03-03 23:50:41 +08:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2017-09-21 03:33:07 +08:00
|
|
|
|
|
2018-03-03 23:50:41 +08:00
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
2017-09-21 03:33:07 +08:00
|
|
|
|
{
|
2017-11-06 13:58:05 +08:00
|
|
|
|
public class RemainingTimeCounter : Counter
|
2017-09-21 03:33:07 +08:00
|
|
|
|
{
|
|
|
|
|
private readonly OsuSpriteText counter;
|
|
|
|
|
|
|
|
|
|
public RemainingTimeCounter()
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
2017-11-06 13:58:05 +08:00
|
|
|
|
InternalChild = counter = new OsuSpriteText
|
2017-09-21 03:33:07 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
TextSize = 33,
|
|
|
|
|
Font = "Venera",
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-06 13:58:05 +08:00
|
|
|
|
protected override void OnCountChanged(double count) => counter.Text = ((int)Math.Ceiling(count / 1000)).ToString();
|
2017-09-21 03:33:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|