1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-24 05:42:55 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs

68 lines
2.3 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-03-21 19:39:18 +08:00
// 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 osu.Framework.Graphics.Shapes;
2017-03-21 19:39:18 +08:00
2017-04-18 15:05:58 +08:00
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
2017-03-21 19:39:18 +08:00
{
2017-04-05 09:37:49 +08:00
public class DrawableBarLineMajor : DrawableBarLine
2017-03-21 19:39:18 +08:00
{
2017-04-03 09:04:13 +08:00
/// <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;
2017-04-05 09:37:49 +08:00
public DrawableBarLineMajor(BarLine barLine)
2017-03-21 19:39:18 +08:00
: base(barLine)
{
2018-03-16 15:09:51 +08:00
AddInternal(triangleContainer = new Container
2017-03-21 19:39:18 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Children = new[]
{
new EquilateralTriangle
{
Name = "Top",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
2017-04-03 09:04:13 +08:00
Position = new Vector2(0, -triangle_offfset),
Size = new Vector2(-triangle_size),
2017-03-21 19:39:18 +08:00
EdgeSmoothness = new Vector2(1),
},
new EquilateralTriangle
{
Name = "Bottom",
Anchor = Anchor.BottomCentre,
Origin = Anchor.TopCentre,
2017-04-03 09:04:13 +08:00
Position = new Vector2(0, triangle_offfset),
Size = new Vector2(triangle_size),
2017-03-21 19:39:18 +08:00
EdgeSmoothness = new Vector2(1),
}
}
2018-03-16 15:09:51 +08:00
});
2017-03-21 19:39:18 +08:00
Tracker.Alpha = 1f;
}
protected override void LoadComplete()
{
base.LoadComplete();
using (triangleContainer.BeginAbsoluteSequence(HitObject.StartTime))
triangleContainer.FadeOut(150);
}
2017-03-21 19:39:18 +08:00
}
}