2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|
|
|
|
{
|
|
|
|
|
public class DrawableBarLineMajor : DrawableBarLine
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The vertical offset of the triangles from the line tracker.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float triangle_offfset = 10f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The size of the triangles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float triangle_size = 20f;
|
|
|
|
|
|
|
|
|
|
private readonly Container triangleContainer;
|
|
|
|
|
|
|
|
|
|
public DrawableBarLineMajor(BarLine barLine)
|
|
|
|
|
: base(barLine)
|
|
|
|
|
{
|
|
|
|
|
AddInternal(triangleContainer = new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new EquilateralTriangle
|
|
|
|
|
{
|
|
|
|
|
Name = "Top",
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Position = new Vector2(0, -triangle_offfset),
|
|
|
|
|
Size = new Vector2(-triangle_size),
|
|
|
|
|
EdgeSmoothness = new Vector2(1),
|
|
|
|
|
},
|
|
|
|
|
new EquilateralTriangle
|
|
|
|
|
{
|
|
|
|
|
Name = "Bottom",
|
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Position = new Vector2(0, triangle_offfset),
|
|
|
|
|
Size = new Vector2(triangle_size),
|
|
|
|
|
EdgeSmoothness = new Vector2(1),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2020-04-23 13:32:48 +08:00
|
|
|
|
Line.Alpha = 1f;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
|
|
using (triangleContainer.BeginAbsoluteSequence(HitObject.StartTime))
|
|
|
|
|
triangleContainer.FadeOut(150);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|