mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Initial commit
This commit is contained in:
87
osu.Game/Screens/Play/SongProgressInfo.cs
Normal file
87
osu.Game/Screens/Play/SongProgressInfo.cs
Normal file
@ -0,0 +1,87 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class SongProgressInfo : Container
|
||||
{
|
||||
private InfoText timeCurrent;
|
||||
private InfoText timeLeft;
|
||||
private InfoText progress;
|
||||
|
||||
private const int margin = 10;
|
||||
|
||||
public string TimeCurrent
|
||||
{
|
||||
set
|
||||
{
|
||||
timeCurrent.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string TimeLeft
|
||||
{
|
||||
set
|
||||
{
|
||||
timeLeft.Text = @"-" + value;
|
||||
}
|
||||
}
|
||||
public string Progress
|
||||
{
|
||||
set
|
||||
{
|
||||
progress.Text = value + @"%";
|
||||
}
|
||||
}
|
||||
|
||||
public SongProgressInfo()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
timeCurrent = new InfoText
|
||||
{
|
||||
Origin = Anchor.BottomLeft,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Margin = new MarginPadding
|
||||
{
|
||||
Left = margin,
|
||||
},
|
||||
},
|
||||
progress = new InfoText
|
||||
{
|
||||
Origin = Anchor.BottomCentre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
},
|
||||
timeLeft = new InfoText
|
||||
{
|
||||
Origin = Anchor.BottomRight,
|
||||
Anchor = Anchor.BottomRight,
|
||||
Margin = new MarginPadding
|
||||
{
|
||||
Right = margin,
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private class InfoText : OsuSpriteText
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Colour = colours.BlueLighter;
|
||||
Font = @"Venera";
|
||||
EdgeEffect = new EdgeEffect
|
||||
{
|
||||
Colour = colours.BlueDarker,
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 5,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user