1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 10:55:45 +08:00
osu-lazer/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs

46 lines
1.4 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.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2018-09-21 13:35:50 +08:00
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
2020-03-31 11:17:44 +08:00
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Mania.UI.Components
{
public class ColumnHitObjectArea : HitObjectArea
{
public readonly Container<Drawable> Explosions;
2019-12-29 23:37:28 +08:00
private readonly Drawable hitTarget;
2018-09-21 13:35:50 +08:00
public ColumnHitObjectArea(HitObjectContainer hitObjectContainer)
: base(hitObjectContainer)
{
AddRangeInternal(new[]
{
2020-03-31 11:17:44 +08:00
hitTarget = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitTarget), _ => new DefaultHitTarget())
{
RelativeSizeAxes = Axes.X,
Depth = 1
},
Explosions = new Container<Drawable>
{
RelativeSizeAxes = Axes.Both,
Depth = -1,
}
});
2020-03-31 11:17:44 +08:00
}
2019-12-28 13:48:10 +08:00
protected override void UpdateHitPosition()
2020-03-31 11:17:44 +08:00
{
base.UpdateHitPosition();
2019-12-28 13:48:10 +08:00
if (Direction.Value == ScrollingDirection.Up)
2020-03-31 11:17:44 +08:00
hitTarget.Anchor = hitTarget.Origin = Anchor.TopLeft;
else
hitTarget.Anchor = hitTarget.Origin = Anchor.BottomLeft;
}
}
}