1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 03:17:18 +08:00

59 lines
1.7 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.
2018-10-29 18:23:23 +09:00
2022-06-17 16:37:17 +09:00
#nullable disable
2018-10-29 18:23:23 +09:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
2020-12-04 20:21:53 +09:00
using osu.Game.Rulesets.Osu.Skinning.Default;
2018-11-20 16:51:59 +09:00
using osuTK;
2018-10-29 18:23:23 +09:00
2018-11-07 16:08:56 +09:00
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components
2018-10-29 18:23:23 +09:00
{
public class SpinnerPiece : BlueprintPiece<Spinner>
2018-10-29 18:23:23 +09:00
{
private readonly CircularContainer circle;
2018-11-09 13:58:46 +09:00
private readonly RingPiece ring;
2018-10-29 18:23:23 +09:00
public SpinnerPiece()
2018-10-29 18:23:23 +09:00
{
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Both;
FillMode = FillMode.Fit;
Size = new Vector2(1.3f);
InternalChildren = new Drawable[]
{
circle = new CircularContainer
{
RelativeSizeAxes = Axes.Both,
Masking = true,
Alpha = 0.5f,
Child = new Box { RelativeSizeAxes = Axes.Both }
},
2020-09-22 17:34:14 +09:00
ring = new RingPiece()
2018-10-29 18:23:23 +09:00
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
public override void UpdateFrom(Spinner hitObject)
{
base.UpdateFrom(hitObject);
ring.Scale = new Vector2(hitObject.Scale);
}
2018-10-29 18:23:23 +09:00
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => circle.ReceivePositionalInputAt(screenSpacePos);
}
}