2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
2018-11-20 07:51:59 +00:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.UI
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A component that is displayed at the hit position in the taiko playfield.
|
|
|
|
|
/// </summary>
|
2020-04-23 03:10:26 +00:00
|
|
|
|
internal class TaikoHitTarget : Container
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Thickness of all drawn line pieces.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float border_thickness = 2.5f;
|
|
|
|
|
|
2020-04-23 03:10:26 +00:00
|
|
|
|
public TaikoHitTarget()
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2020-04-21 10:00:34 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
Name = "Bar Upper",
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
2020-12-14 20:46:02 +00:00
|
|
|
|
Size = new Vector2(border_thickness, (1 - TaikoStrongableHitObject.DEFAULT_STRONG_SIZE) / 2f),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Alpha = 0.1f
|
|
|
|
|
},
|
|
|
|
|
new CircularContainer
|
|
|
|
|
{
|
|
|
|
|
Name = "Strong Hit Ring",
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2020-12-14 20:46:02 +00:00
|
|
|
|
Size = new Vector2(TaikoStrongableHitObject.DEFAULT_STRONG_SIZE),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Masking = true,
|
|
|
|
|
BorderColour = Color4.White,
|
|
|
|
|
BorderThickness = border_thickness,
|
|
|
|
|
Alpha = 0.1f,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new CircularContainer
|
|
|
|
|
{
|
|
|
|
|
Name = "Normal Hit Ring",
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2020-06-29 05:38:50 +00:00
|
|
|
|
Size = new Vector2(TaikoHitObject.DEFAULT_SIZE),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Masking = true,
|
|
|
|
|
BorderColour = Color4.White,
|
|
|
|
|
BorderThickness = border_thickness,
|
|
|
|
|
Alpha = 0.5f,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
Name = "Bar Lower",
|
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
2020-12-14 20:46:02 +00:00
|
|
|
|
Size = new Vector2(border_thickness, (1 - TaikoStrongableHitObject.DEFAULT_STRONG_SIZE) / 2f),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Alpha = 0.1f
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|