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.Shapes;
|
2019-09-10 12:29:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A line that scrolls alongside hit objects in the playfield and visualises control points.
|
|
|
|
|
/// </summary>
|
2019-09-10 12:29:50 +08:00
|
|
|
|
public class DrawableBarLine : DrawableHitObject<HitObject>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The width of the line tracker.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float tracker_width = 2f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fade out time calibrated to a pre-empt of 1000ms.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float base_fadeout_time = 100f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The visual line tracker.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected Box Tracker;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The bar line.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected readonly BarLine BarLine;
|
|
|
|
|
|
|
|
|
|
public DrawableBarLine(BarLine barLine)
|
|
|
|
|
: base(barLine)
|
|
|
|
|
{
|
|
|
|
|
BarLine = barLine;
|
|
|
|
|
|
|
|
|
|
Anchor = Anchor.CentreLeft;
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.Y;
|
|
|
|
|
Width = tracker_width;
|
|
|
|
|
|
2019-03-25 12:47:28 +08:00
|
|
|
|
AddInternal(Tracker = new Box
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-03-25 12:47:28 +08:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
EdgeSmoothness = new Vector2(0.5f, 0),
|
|
|
|
|
Alpha = 0.75f
|
|
|
|
|
});
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
2020-02-23 12:50:05 +08:00
|
|
|
|
|
|
|
|
|
protected override void UpdateStateTransforms(ArmedState state) => this.FadeOut(150);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|