1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 02:37:19 +08:00

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
3.2 KiB
C#
Raw Normal View History

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