2017-03-21 14:09:54 +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 OpenTK;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Modes.Taiko.Objects;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Modes.Taiko.UI
|
|
|
|
|
{
|
|
|
|
|
internal class HitTarget : Container
|
|
|
|
|
{
|
2017-03-21 16:48:19 +08:00
|
|
|
|
private const float normal_diameter = TaikoHitObject.CIRCLE_RADIUS * 2 * TaikoPlayfield.PLAYFIELD_SCALE;
|
|
|
|
|
private const float finisher_diameter = normal_diameter * 1.5f;
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
|
|
|
|
public HitTarget()
|
|
|
|
|
{
|
2017-03-21 16:48:19 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Y;
|
|
|
|
|
|
2017-03-21 14:09:54 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Name = "Bar Upper",
|
|
|
|
|
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Size = new Vector2(3, (TaikoPlayfield.PlayfieldHeight - finisher_diameter) / 2f),
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Alpha = 0.1f
|
2017-03-21 14:09:54 +08:00
|
|
|
|
},
|
2017-03-21 16:48:19 +08:00
|
|
|
|
new CircularContainer
|
2017-03-21 14:09:54 +08:00
|
|
|
|
{
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Name = "Finisher Ring",
|
|
|
|
|
|
2017-03-21 14:09:54 +08:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Size = new Vector2(finisher_diameter),
|
|
|
|
|
|
|
|
|
|
BorderColour = Color4.White,
|
|
|
|
|
BorderThickness = 2,
|
|
|
|
|
Alpha = 0.1f,
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Children = new[]
|
2017-03-21 14:09:54 +08:00
|
|
|
|
{
|
2017-03-21 16:48:19 +08:00
|
|
|
|
new Box
|
2017-03-21 14:09:54 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new CircularContainer
|
|
|
|
|
{
|
|
|
|
|
Name = "Normal Ring",
|
|
|
|
|
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Size = new Vector2(normal_diameter),
|
|
|
|
|
|
|
|
|
|
BorderColour = Color4.White,
|
|
|
|
|
BorderThickness = 2,
|
|
|
|
|
Alpha = 0.5f,
|
|
|
|
|
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
2017-03-21 14:09:54 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true
|
2017-03-21 14:09:54 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-21 16:48:19 +08:00
|
|
|
|
},
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
Name = "Bar Lower",
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
|
Origin = Anchor.BottomCentre,
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Size = new Vector2(3, (TaikoPlayfield.PlayfieldHeight - finisher_diameter) / 2f),
|
2017-03-21 14:09:54 +08:00
|
|
|
|
|
2017-03-21 16:48:19 +08:00
|
|
|
|
Alpha = 0.1f
|
|
|
|
|
},
|
2017-03-21 14:09:54 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|