1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-24 05:42:55 +08:00
osu-lazer/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs

46 lines
1.5 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
{
2020-04-02 14:57:50 +08:00
public readonly Container Explosions;
2019-12-29 23:37:28 +08:00
private readonly Drawable hitTarget;
public ColumnHitObjectArea(int columnIndex, HitObjectContainer hitObjectContainer)
: base(hitObjectContainer)
{
AddRangeInternal(new[]
{
hitTarget = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitTarget, columnIndex), _ => new DefaultHitTarget())
{
RelativeSizeAxes = Axes.X,
Depth = 1
},
2020-04-02 14:57:50 +08:00
Explosions = new Container
{
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;
}
}
}