1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 21:27:25 +08:00

Merge pull request #20404 from peppy/argon-cursor

Add basic "argon" cursor
This commit is contained in:
Dean Herbert 2022-09-22 22:44:38 +09:00 committed by GitHub
commit dc7b62fbff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,80 @@
// 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.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Osu.UI.Cursor;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
public class ArgonCursor : OsuCursorSprite
{
public ArgonCursor()
{
RelativeSizeAxes = Axes.Both;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
InternalChildren = new[]
{
ExpandTarget = new CircularContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = 6,
BorderColour = ColourInfo.GradientVertical(Colour4.FromHex("FC618F"), Colour4.FromHex("BB1A41")),
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0.4f,
Colour = Colour4.FromHex("FC618F").Darken(0.6f),
},
new CircularContainer
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = 2,
BorderColour = Color4.White.Opacity(0.8f),
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true,
},
},
},
},
},
new Circle
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Scale = new Vector2(0.2f),
Colour = new Color4(255, 255, 255, 255),
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Radius = 20,
Colour = new Color4(171, 255, 255, 100),
},
},
};
}
}
}

View File

@ -0,0 +1,29 @@
// 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.Graphics;
using osu.Framework.Graphics.Textures;
using osu.Game.Rulesets.Osu.UI.Cursor;
using osuTK;
namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
public class ArgonCursorTrail : CursorTrail
{
protected override float IntervalMultiplier => 0.4f;
protected override float FadeExponent => 4;
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
Texture = textures.Get(@"Cursor/cursortrail");
Scale = new Vector2(0.8f / Texture.ScaleAdjust);
Blending = BlendingParameters.Additive;
Alpha = 0.8f;
}
}
}

View File

@ -47,6 +47,12 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
case OsuSkinComponents.FollowPoint:
return new ArgonFollowPoint();
case OsuSkinComponents.Cursor:
return new ArgonCursor();
case OsuSkinComponents.CursorTrail:
return new ArgonCursorTrail();
}
break;