mirror of
https://github.com/ppy/osu.git
synced 2024-11-18 21:43:22 +08:00
93 lines
3.2 KiB
C#
93 lines
3.2 KiB
C#
// Copyright (c) 2007-2018 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.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>
|
|
internal class HitTarget : Container
|
|
{
|
|
/// <summary>
|
|
/// Thickness of all drawn line pieces.
|
|
/// </summary>
|
|
private const float border_thickness = 2.5f;
|
|
|
|
public HitTarget()
|
|
{
|
|
Children = new Drawable[]
|
|
{
|
|
new Box
|
|
{
|
|
Name = "Bar Upper",
|
|
Anchor = Anchor.TopCentre,
|
|
Origin = Anchor.TopCentre,
|
|
RelativeSizeAxes = Axes.Y,
|
|
Size = new Vector2(border_thickness, (1 - TaikoHitObject.DEFAULT_STRONG_SIZE) / 2f),
|
|
Alpha = 0.1f
|
|
},
|
|
new CircularContainer
|
|
{
|
|
Name = "Strong Hit Ring",
|
|
Anchor = Anchor.Centre,
|
|
Origin = Anchor.Centre,
|
|
RelativeSizeAxes = Axes.Both,
|
|
FillMode = FillMode.Fit,
|
|
Scale = new Vector2(TaikoHitObject.DEFAULT_STRONG_SIZE),
|
|
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,
|
|
FillMode = FillMode.Fit,
|
|
Scale = new Vector2(TaikoHitObject.DEFAULT_SIZE),
|
|
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,
|
|
Size = new Vector2(border_thickness, (1 - TaikoHitObject.DEFAULT_STRONG_SIZE) / 2f),
|
|
Alpha = 0.1f
|
|
},
|
|
};
|
|
}
|
|
}
|
|
}
|