1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 14:02:54 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHitTarget.cs

48 lines
1.6 KiB
C#
Raw Normal View History

2022-09-27 18:48:27 +08: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.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
2022-09-27 18:48:27 +08:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.UI.Scrolling;
2022-09-27 18:48:27 +08:00
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Skinning.Argon
{
2022-11-24 13:32:20 +08:00
public partial class ArgonHitTarget : CompositeDrawable
2022-09-27 18:48:27 +08:00
{
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
2022-09-27 18:48:27 +08:00
[BackgroundDependencyLoader]
private void load(IScrollingInfo scrollingInfo)
2022-09-27 18:48:27 +08:00
{
RelativeSizeAxes = Axes.X;
Height = ArgonNotePiece.NOTE_HEIGHT * ArgonNotePiece.NOTE_ACCENT_RATIO;
2022-09-27 18:48:27 +08:00
Masking = true;
CornerRadius = ArgonNotePiece.CORNER_RADIUS;
2022-09-27 18:48:27 +08:00
InternalChildren = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0.3f,
Blending = BlendingParameters.Additive,
Colour = Color4.White
},
};
direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(onDirectionChanged, true);
}
private void onDirectionChanged(ValueChangedEvent<ScrollingDirection> direction)
{
Anchor = Origin = direction.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
2022-09-27 18:48:27 +08:00
}
}
}