2017-04-05 09:01:40 +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 osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using OpenTK.Graphics;
|
2017-06-20 13:54:23 +08:00
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2017-04-05 09:01:40 +08:00
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
2017-04-05 09:01:40 +08:00
|
|
|
|
{
|
|
|
|
|
public class TickPiece : TaikoPiece
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Any tick that is not the first for a drumroll is not filled, but is instead displayed
|
|
|
|
|
/// as a hollow circle. This is what controls the border width of that circle.
|
|
|
|
|
/// </summary>
|
2017-08-03 12:23:12 +08:00
|
|
|
|
private const float tick_border_width = 5;
|
2017-04-05 09:01:40 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The size of a tick.
|
|
|
|
|
/// </summary>
|
2017-08-03 12:23:12 +08:00
|
|
|
|
private const float tick_size = 14;
|
2017-04-05 09:01:40 +08:00
|
|
|
|
|
|
|
|
|
private bool filled;
|
|
|
|
|
public bool Filled
|
|
|
|
|
{
|
|
|
|
|
get { return filled; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
filled = value;
|
|
|
|
|
fillBox.Alpha = filled ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private readonly Box fillBox;
|
|
|
|
|
|
|
|
|
|
public TickPiece()
|
|
|
|
|
{
|
2017-08-03 12:23:12 +08:00
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.None;
|
2017-04-05 09:01:40 +08:00
|
|
|
|
Size = new Vector2(tick_size);
|
|
|
|
|
|
|
|
|
|
Add(new CircularContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Masking = true,
|
|
|
|
|
BorderThickness = tick_border_width,
|
|
|
|
|
BorderColour = Color4.White,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
fillBox = new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|