1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

refactor(hud/gameplay/SongProgressInfo): minor changes to text positioning, font and colour

This commit is contained in:
tsrk 2023-01-09 21:57:32 +01:00
parent f6265197e8
commit 28d2d766eb
No known key found for this signature in database
GPG Key ID: EBD46BB3049B56D6

View File

@ -10,6 +10,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using System;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Screens.Play.HUD
{
@ -27,13 +28,33 @@ namespace osu.Game.Screens.Play.HUD
private double songLength => endTime - startTime;
private const int margin = 10;
public FontUsage Font
{
set
{
timeCurrent.Font = value;
timeLeft.Font = value;
progress.Font = value;
}
}
public Colour4 TextColour
{
set
{
timeCurrent.Colour = value;
timeLeft.Colour = value;
progress.Colour = value;
}
}
public double StartTime
{
set => startTime = value;
}
public bool ShowProgress = true;
public double EndTime
{
set => endTime = value;
@ -76,6 +97,7 @@ namespace osu.Game.Screens.Play.HUD
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Alpha = ShowProgress ? 1 : 0,
Child = new UprightAspectMaintainingContainer
{
Origin = Anchor.Centre,
@ -99,15 +121,15 @@ namespace osu.Game.Screens.Play.HUD
AutoSizeAxes = Axes.Both,
Child = new UprightAspectMaintainingContainer
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight,
AutoSizeAxes = Axes.Both,
Scaling = ScaleMode.Vertical,
ScalingFactor = 0.5f,
Child = timeLeft = new SizePreservingSpriteText
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight,
Colour = colours.BlueLighter,
Font = OsuFont.Numeric,
}
@ -128,7 +150,7 @@ namespace osu.Game.Screens.Play.HUD
if (currentPercent != previousPercent)
{
progress.Text = currentPercent.ToString() + @"%";
progress.Text = currentPercent + @"%";
previousPercent = currentPercent;
}