1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 13:23:05 +08:00

Design improvements

paired with smoogi
This commit is contained in:
Dean Herbert 2017-05-18 21:38:19 +09:00
parent 4100c4fe9f
commit e3ae2bca6d
5 changed files with 45 additions and 31 deletions

View File

@ -26,6 +26,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly SpinnerBackground background; private readonly SpinnerBackground background;
private readonly Container circleContainer; private readonly Container circleContainer;
private readonly CirclePiece circle; private readonly CirclePiece circle;
private readonly GlowPiece glow;
private readonly TextAwesome symbol; private readonly TextAwesome symbol;
@ -42,7 +43,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
// we are slightly bigger than our parent, to clip the top and bottom of the circle // we are slightly bigger than our parent, to clip the top and bottom of the circle
Height = 1.2f; Height = 1.3f;
spinner = s; spinner = s;
@ -55,6 +56,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Origin = Anchor.Centre, Origin = Anchor.Centre,
Children = new Drawable[] Children = new Drawable[]
{ {
glow = new GlowPiece(),
circle = new CirclePiece circle = new CirclePiece
{ {
Position = Vector2.Zero, Position = Vector2.Zero,
@ -69,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
TextSize = 48, TextSize = 48,
Icon = FontAwesome.fa_asterisk, Icon = FontAwesome.fa_asterisk,
Shadow = false, Shadow = false,
} },
} }
}, },
mainContainer = new AspectContainer mainContainer = new AspectContainer
@ -81,7 +83,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
background = new SpinnerBackground background = new SpinnerBackground
{ {
Alpha = 0.2f, Alpha = 0.6f,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
}, },
@ -112,9 +114,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
disc.Complete = true; disc.Complete = true;
disc.FadeAccent(completeColour, 500); const float duration = 200;
background.FadeAccent(completeColour, 500);
circle.FadeColour(completeColour, 500); disc.FadeAccent(completeColour, duration);
background.FadeAccent(completeColour, duration);
background.FadeOut(duration);
circle.FadeColour(completeColour, duration);
glow.FadeColour(completeColour, duration);
} }
if (!userTriggered && Time.Current >= spinner.EndTime) if (!userTriggered && Time.Current >= spinner.EndTime)
@ -146,12 +154,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
normalColour = colours.BlueDark; normalColour = colours.SpinnerFill;
completeColour = colours.YellowLight.Opacity(0.8f); background.AccentColour = colours.SpinnerBackground;
completeColour = colours.YellowLight.Opacity(0.6f);
disc.AccentColour = normalColour; disc.AccentColour = normalColour;
background.AccentColour = normalColour; circle.Colour = colours.BlueDarker;
circle.Colour = normalColour; glow.Colour = colours.BlueDarker;
} }
protected override void UpdateAfterChildren() protected override void UpdateAfterChildren()

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -15,12 +14,25 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
public override bool HandleInput => false; public override bool HandleInput => false;
protected Sprite Disc; protected Box Disc;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return Disc.Colour; } get
set { Disc.Colour = value; } {
return Disc.Colour;
}
set
{
Disc.Colour = value;
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Radius = 14,
Colour = value.Opacity(0.3f),
};
}
} }
public SpinnerBackground() public SpinnerBackground()
@ -39,16 +51,5 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
}, },
}; };
} }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Radius = 14,
Colour = colours.BlueLight.Opacity(0.3f),
};
}
} }
} }

View File

@ -24,8 +24,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private readonly SpinnerBackground background; private readonly SpinnerBackground background;
private const float idle_alpha = 0.1f; private const float idle_alpha = 0.2f;
private const float tracking_alpha = 0.3f; private const float tracking_alpha = 0.4f;
public SpinnerDisc(Spinner s) public SpinnerDisc(Spinner s)
{ {
@ -127,9 +127,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
if (Complete && updateCompleteTick()) if (Complete && updateCompleteTick())
{ {
background.Flush(flushType: typeof(TransformAlpha)); background.Flush(flushType: typeof(TransformAlpha));
background.FadeTo(0.75f, 60, EasingTypes.OutExpo); background.FadeTo(tracking_alpha + 0.4f, 60, EasingTypes.OutExpo);
background.Delay(60); background.Delay(60);
background.FadeTo(0.5f, 250, EasingTypes.OutQuint); background.FadeTo(tracking_alpha, 250, EasingTypes.OutQuint);
} }
RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, EasingTypes.OutExpo); RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, EasingTypes.OutExpo);

View File

@ -53,8 +53,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
Size = new Vector2(60, 10), Size = new Vector2(60, 10),
Origin = Anchor.Centre, Origin = Anchor.Centre,
Position = new Vector2( Position = new Vector2(
0.5f + (float)Math.Sin((float)i / count * 2 * MathHelper.Pi) / 2 * 0.9f, 0.5f + (float)Math.Sin((float)i / count * 2 * MathHelper.Pi) / 2 * 0.86f,
0.5f + (float)Math.Cos((float)i / count * 2 * MathHelper.Pi) / 2 * 0.9f 0.5f + (float)Math.Cos((float)i / count * 2 * MathHelper.Pi) / 2 * 0.86f
), ),
Rotation = -(float)i / count * 360 + 90, Rotation = -(float)i / count * 360 + 90,
Children = new[] Children = new[]

View File

@ -87,5 +87,8 @@ namespace osu.Game.Graphics
public readonly Color4 RedDarker = FromHex(@"870000"); public readonly Color4 RedDarker = FromHex(@"870000");
public readonly Color4 ChatBlue = FromHex(@"17292e"); public readonly Color4 ChatBlue = FromHex(@"17292e");
public readonly Color4 SpinnerBackground = FromHex(@"05222b");
public readonly Color4 SpinnerFill = FromHex(@"002c3c");
} }
} }