Add slider ball

This commit is contained in:
Dean Herbert 2022-09-19 14:58:27 +09:00
parent cd84503e62
commit ef6ea49b18
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,55 @@
// 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.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
public class ArgonSliderBall : CircularContainer
{
private readonly Box fill;
private readonly SpriteIcon icon;
public ArgonSliderBall()
{
Size = new Vector2(ArgonMainCirclePiece.OUTER_GRADIENT_SIZE);
Masking = true;
BorderThickness = ArgonMainCirclePiece.BORDER_THICKNESS * 2;
BorderColour = Color4.White;
InternalChildren = new Drawable[]
{
fill = new Box
{
Colour = ColourInfo.GradientVertical(Colour4.FromHex("FC618F"), Colour4.FromHex("BB1A41")),
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
icon = new SpriteIcon
{
Size = new Vector2(48),
Scale = new Vector2(0.6f, 0.8f),
Icon = FontAwesome.Solid.AngleRight,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
}
};
}
protected override void Update()
{
base.Update();
fill.Rotation = -Rotation;
}
}
}

View File

@ -33,6 +33,12 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
case OsuSkinComponents.SliderBody:
return new ArgonSliderBody();
case OsuSkinComponents.SliderBall:
return new ArgonSliderBall();
case OsuSkinComponents.SliderScorePoint:
return new ArgonSliderScorePoint();
}
break;