mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Add barline drawables.
This commit is contained in:
@ -6,6 +6,7 @@ using osu.Framework.Screens.Testing;
|
|||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
using osu.Game.Modes.Taiko.Objects;
|
using osu.Game.Modes.Taiko.Objects;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawable;
|
||||||
using osu.Game.Modes.Taiko.UI;
|
using osu.Game.Modes.Taiko.UI;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
73
osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs
Normal file
73
osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
// 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 osu.Game.Modes.Taiko.UI;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A line that scrolls alongside hit objects in the playfield and visualises control points.
|
||||||
|
/// </summary>
|
||||||
|
public class DrawableBarLine : Container
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The line.
|
||||||
|
/// </summary>
|
||||||
|
protected Box Tracker;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The
|
||||||
|
/// </summary>
|
||||||
|
protected readonly BarLine BarLine;
|
||||||
|
|
||||||
|
public DrawableBarLine(BarLine barLine)
|
||||||
|
{
|
||||||
|
BarLine = barLine;
|
||||||
|
|
||||||
|
Anchor = Anchor.CentreLeft;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
RelativePositionAxes = Axes.X;
|
||||||
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
Width = 2f;
|
||||||
|
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
Tracker = new Box
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
|
||||||
|
EdgeSmoothness = new Vector2(0.5f, 0),
|
||||||
|
Alpha = 0.75f
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LifetimeStart = BarLine.StartTime - BarLine.PreEmpt * 2;
|
||||||
|
LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
Delay(BarLine.StartTime);
|
||||||
|
FadeOut(100 * BarLine.PreEmpt / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void moveToTimeOffset(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.PreEmpt));
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
moveToTimeOffset(Time.Current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
// 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
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
|
||||||
|
Position = new Vector2(0, -10),
|
||||||
|
Size = new Vector2(-20),
|
||||||
|
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
},
|
||||||
|
new EquilateralTriangle
|
||||||
|
{
|
||||||
|
Name = "Bottom",
|
||||||
|
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
|
||||||
|
Position = new Vector2(0, 10),
|
||||||
|
Size = new Vector2(20),
|
||||||
|
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Tracker.Alpha = 1f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -14,6 +14,7 @@ using osu.Game.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawable;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.UI
|
namespace osu.Game.Modes.Taiko.UI
|
||||||
{
|
{
|
||||||
@ -47,7 +48,7 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
protected override Container<Drawable> Content => hitObjectContainer;
|
protected override Container<Drawable> Content => hitObjectContainer;
|
||||||
|
|
||||||
private Container<RingExplosion> ringExplosionContainer;
|
private Container<RingExplosion> ringExplosionContainer;
|
||||||
//private Container<DrawableBarLine> barLineContainer;
|
private Container<DrawableBarLine> barLineContainer;
|
||||||
private Container<JudgementText> judgementContainer;
|
private Container<JudgementText> judgementContainer;
|
||||||
|
|
||||||
private Container hitObjectContainer;
|
private Container hitObjectContainer;
|
||||||
@ -105,10 +106,10 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
Scale = new Vector2(PLAYFIELD_SCALE),
|
Scale = new Vector2(PLAYFIELD_SCALE),
|
||||||
BlendingMode = BlendingMode.Additive
|
BlendingMode = BlendingMode.Additive
|
||||||
},
|
},
|
||||||
//barLineContainer = new Container<DrawableBarLine>
|
barLineContainer = new Container<DrawableBarLine>
|
||||||
//{
|
{
|
||||||
// RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
//},
|
},
|
||||||
new HitTarget
|
new HitTarget
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
|
@ -52,6 +52,8 @@
|
|||||||
<Compile Include="Judgements\TaikoJudgementInfo.cs" />
|
<Compile Include="Judgements\TaikoJudgementInfo.cs" />
|
||||||
<Compile Include="Judgements\TaikoScoreResult.cs" />
|
<Compile Include="Judgements\TaikoScoreResult.cs" />
|
||||||
<Compile Include="Objects\BarLine.cs" />
|
<Compile Include="Objects\BarLine.cs" />
|
||||||
|
<Compile Include="Objects\Drawable\DrawableBarLine.cs" />
|
||||||
|
<Compile Include="Objects\Drawable\DrawableMajorBarLine.cs" />
|
||||||
<Compile Include="TaikoDifficultyCalculator.cs" />
|
<Compile Include="TaikoDifficultyCalculator.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableTaikoHit.cs" />
|
<Compile Include="Objects\Drawable\DrawableTaikoHit.cs" />
|
||||||
<Compile Include="Objects\TaikoHitObject.cs" />
|
<Compile Include="Objects\TaikoHitObject.cs" />
|
||||||
|
Reference in New Issue
Block a user