2017-03-22 19:54:21 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK;
|
2017-02-10 04:28:40 +08:00
|
|
|
|
using OpenTK.Graphics;
|
2017-03-22 19:54:21 +08:00
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-02-10 04:28:40 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
|
2017-03-22 19:54:21 +08:00
|
|
|
|
namespace osu.Game.Screens.Play
|
|
|
|
|
{
|
|
|
|
|
public class SongProgressBar : DragBar
|
|
|
|
|
{
|
2017-03-23 18:38:08 +08:00
|
|
|
|
public SongProgressBar(float barHeight, float handleBarHeight, Vector2 handleSize, Color4 fillColour)
|
2017-03-22 19:54:21 +08:00
|
|
|
|
{
|
2017-03-23 17:37:12 +08:00
|
|
|
|
Fill.Colour = fillColour;
|
2017-03-23 18:38:08 +08:00
|
|
|
|
Height = barHeight + handleBarHeight + handleSize.Y;
|
|
|
|
|
FillContainer.RelativeSizeAxes = Axes.X;
|
|
|
|
|
FillContainer.Height = barHeight;
|
2017-03-22 19:54:21 +08:00
|
|
|
|
|
|
|
|
|
Add(new Box
|
|
|
|
|
{
|
2017-03-23 18:38:08 +08:00
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Height = barHeight,
|
2017-03-22 19:54:21 +08:00
|
|
|
|
Colour = Color4.Black,
|
|
|
|
|
Alpha = 0.5f,
|
|
|
|
|
Depth = 1
|
|
|
|
|
});
|
2017-03-22 19:59:44 +08:00
|
|
|
|
FillContainer.Add(new Container
|
2017-02-10 04:28:40 +08:00
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.BottomRight,
|
|
|
|
|
Anchor = Anchor.BottomRight,
|
|
|
|
|
Width = 2,
|
2017-03-23 18:38:08 +08:00
|
|
|
|
Height = barHeight + handleBarHeight,
|
2017-03-22 19:54:21 +08:00
|
|
|
|
Colour = Color4.White,
|
2017-02-10 04:28:40 +08:00
|
|
|
|
Position = new Vector2(2, 0),
|
2017-03-22 19:54:21 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
2017-03-23 17:37:12 +08:00
|
|
|
|
Size = handleSize,
|
2017-03-22 19:54:21 +08:00
|
|
|
|
CornerRadius = 5,
|
|
|
|
|
Masking = true,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = Color4.White
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|