1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 10:57:30 +08:00
osu-lazer/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs

57 lines
1.9 KiB
C#
Raw Normal View History

2017-03-21 19:39:18 +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 osu.Framework.Graphics.Sprites;
using OpenTK;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableMajorBarLine : DrawableBarLine
{
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;
2017-03-21 19:39:18 +08:00
public DrawableMajorBarLine(BarLine barLine)
: base(barLine)
{
Add(new Container
{
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),
}
}
});
Tracker.Alpha = 1f;
}
}
}