2019-01-24 16:43:03 +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.
|
2018-10-29 17:23:23 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-10-29 17:23:23 +08:00
|
|
|
|
|
2018-11-07 15:08:56 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components
|
2018-10-29 17:23:23 +08:00
|
|
|
|
{
|
2019-09-27 17:45:22 +08:00
|
|
|
|
public partial class SpinnerPiece : BlueprintPiece<Spinner>
|
2018-10-29 17:23:23 +08:00
|
|
|
|
{
|
2022-10-27 15:15:22 +08:00
|
|
|
|
private readonly Circle circle;
|
|
|
|
|
private readonly Circle ring;
|
2018-10-29 17:23:23 +08:00
|
|
|
|
|
2019-09-27 17:45:22 +08:00
|
|
|
|
public SpinnerPiece()
|
2018-10-29 17:23:23 +08:00
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
FillMode = FillMode.Fit;
|
2022-10-27 15:15:22 +08:00
|
|
|
|
Size = new Vector2(1);
|
2018-10-29 17:23:23 +08:00
|
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
2022-10-27 15:15:22 +08:00
|
|
|
|
circle = new Circle
|
2018-10-29 17:23:23 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0.5f,
|
|
|
|
|
},
|
2022-10-27 15:15:22 +08:00
|
|
|
|
ring = new Circle
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS),
|
|
|
|
|
},
|
2018-10-29 17:23:23 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
Colour = colours.Yellow;
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-27 17:45:22 +08:00
|
|
|
|
public override void UpdateFrom(Spinner hitObject)
|
2019-09-27 17:00:24 +08:00
|
|
|
|
{
|
2019-09-27 17:45:22 +08:00
|
|
|
|
base.UpdateFrom(hitObject);
|
2019-09-27 17:00:24 +08:00
|
|
|
|
|
2019-09-27 17:45:22 +08:00
|
|
|
|
ring.Scale = new Vector2(hitObject.Scale);
|
2019-09-27 17:00:24 +08:00
|
|
|
|
}
|
2018-10-29 17:23:23 +08:00
|
|
|
|
|
|
|
|
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => circle.ReceivePositionalInputAt(screenSpacePos);
|
|
|
|
|
}
|
|
|
|
|
}
|