mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Split visuals of HitCircleSelectionMask into HitCircleMask
This commit is contained in:
parent
677d0d4a19
commit
e1db2bbc25
35
osu.Game.Rulesets.Osu/Edit/Masks/HitCircleMask.cs
Normal file
35
osu.Game.Rulesets.Osu/Edit/Masks/HitCircleMask.cs
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Edit.Masks
|
||||
{
|
||||
public class HitCircleMask : CompositeDrawable
|
||||
{
|
||||
public HitCircleMask(HitCircle hitCircle)
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Size = new Vector2((float)OsuHitObject.OBJECT_RADIUS * 2);
|
||||
Scale = new Vector2(hitCircle.Scale);
|
||||
|
||||
CornerRadius = Size.X / 2;
|
||||
|
||||
AddInternal(new RingPiece());
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Colour = colours.Yellow;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +1,10 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Edit.Masks
|
||||
{
|
||||
@ -16,22 +14,12 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks
|
||||
: base(hitCircle)
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Position = hitCircle.Position;
|
||||
Size = hitCircle.Size;
|
||||
Scale = hitCircle.Scale;
|
||||
|
||||
CornerRadius = Size.X / 2;
|
||||
|
||||
AddInternal(new RingPiece());
|
||||
InternalChild = new HitCircleMask((HitCircle)hitCircle.HitObject);
|
||||
|
||||
hitCircle.HitObject.PositionChanged += _ => Position = hitCircle.Position;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Colour = colours.Yellow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user