From 901102918ee29241406f716e3a2c014a8995c116 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 5 Nov 2020 19:05:59 +0900 Subject: [PATCH] Centralise scale and apply to SPIN text --- osu.Game.Rulesets.Osu/Skinning/LegacyNewStyleSpinner.cs | 6 ++---- osu.Game.Rulesets.Osu/Skinning/LegacyOldStyleSpinner.cs | 9 ++++----- osu.Game.Rulesets.Osu/Skinning/LegacySpinner.cs | 4 ++++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/LegacyNewStyleSpinner.cs b/osu.Game.Rulesets.Osu/Skinning/LegacyNewStyleSpinner.cs index 3a60f54d24..05f4c8e307 100644 --- a/osu.Game.Rulesets.Osu/Skinning/LegacyNewStyleSpinner.cs +++ b/osu.Game.Rulesets.Osu/Skinning/LegacyNewStyleSpinner.cs @@ -27,8 +27,6 @@ namespace osu.Game.Rulesets.Osu.Skinning private Sprite spinningMiddle; private Sprite fixedMiddle; - private const float final_scale = 0.625f; - private readonly Color4 glowColour = new Color4(3, 151, 255, 255); private Container scaleContainer; @@ -38,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Skinning { AddInternal(scaleContainer = new Container { - Scale = new Vector2(final_scale), + Scale = new Vector2(SPRITE_SCALE), Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, @@ -127,7 +125,7 @@ namespace osu.Game.Rulesets.Osu.Skinning glow.Alpha = DrawableSpinner.Progress; - scaleContainer.Scale = new Vector2(final_scale * (0.8f + (float)Interpolation.ApplyEasing(Easing.Out, DrawableSpinner.Progress) * 0.2f)); + scaleContainer.Scale = new Vector2(SPRITE_SCALE * (0.8f + (float)Interpolation.ApplyEasing(Easing.Out, DrawableSpinner.Progress) * 0.2f)); } } } diff --git a/osu.Game.Rulesets.Osu/Skinning/LegacyOldStyleSpinner.cs b/osu.Game.Rulesets.Osu/Skinning/LegacyOldStyleSpinner.cs index dd63879247..fba802f085 100644 --- a/osu.Game.Rulesets.Osu/Skinning/LegacyOldStyleSpinner.cs +++ b/osu.Game.Rulesets.Osu/Skinning/LegacyOldStyleSpinner.cs @@ -26,8 +26,7 @@ namespace osu.Game.Rulesets.Osu.Skinning private bool spinnerBlink; - private const float sprite_scale = 1 / 1.6f; - private const float final_metre_height = 692 * sprite_scale; + private const float final_metre_height = 692 * SPRITE_SCALE; [BackgroundDependencyLoader] private void load(ISkinSource source) @@ -50,14 +49,14 @@ namespace osu.Game.Rulesets.Osu.Skinning Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-background"), - Scale = new Vector2(sprite_scale) + Scale = new Vector2(SPRITE_SCALE) }, disc = new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = source.GetTexture("spinner-circle"), - Scale = new Vector2(sprite_scale) + Scale = new Vector2(SPRITE_SCALE) }, metre = new Container { @@ -73,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Skinning Texture = source.GetTexture("spinner-metre"), Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, - Scale = new Vector2(0.625f) + Scale = new Vector2(SPRITE_SCALE) } } } diff --git a/osu.Game.Rulesets.Osu/Skinning/LegacySpinner.cs b/osu.Game.Rulesets.Osu/Skinning/LegacySpinner.cs index 62df4989ba..2d0d350fce 100644 --- a/osu.Game.Rulesets.Osu/Skinning/LegacySpinner.cs +++ b/osu.Game.Rulesets.Osu/Skinning/LegacySpinner.cs @@ -9,11 +9,14 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Skinning; +using osuTK; namespace osu.Game.Rulesets.Osu.Skinning { public abstract class LegacySpinner : CompositeDrawable { + protected const float SPRITE_SCALE = 0.625f; + protected DrawableSpinner DrawableSpinner { get; private set; } private Sprite spin; @@ -33,6 +36,7 @@ namespace osu.Game.Rulesets.Osu.Skinning Origin = Anchor.Centre, Depth = float.MinValue, Texture = source.GetTexture("spinner-spin"), + Scale = new Vector2(SPRITE_SCALE), Y = 120 // todo: make match roughly? }, });