mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Move spinner top offset constant outside
This commit is contained in:
@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
// this anchor makes no sense, but that's what stable uses.
|
// this anchor makes no sense, but that's what stable uses.
|
||||||
Anchor = Anchor.TopLeft,
|
Anchor = Anchor.TopLeft,
|
||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
Margin = new MarginPadding { Top = LegacyCoordinatesContainer.SPINNER_TOP_OFFSET },
|
Margin = new MarginPadding { Top = SPINNER_TOP_OFFSET },
|
||||||
Masking = true,
|
Masking = true,
|
||||||
Child = metreSprite = new Sprite
|
Child = metreSprite = new Sprite
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,13 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
{
|
{
|
||||||
public abstract class LegacySpinner : CompositeDrawable
|
public abstract class LegacySpinner : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An offset that simulates stable's spinner top offset, can be used with <see cref="LegacyCoordinatesContainer"/>
|
||||||
|
/// for positioning some legacy spinner components perfectly as in stable.
|
||||||
|
/// (e.g. 'spin' sprite, 'clear' sprite, metre in old-style spinners)
|
||||||
|
/// </summary>
|
||||||
|
public static readonly float SPINNER_TOP_OFFSET = (float)Math.Ceiling(45f * SPRITE_SCALE);
|
||||||
|
|
||||||
protected const float SPRITE_SCALE = 0.625f;
|
protected const float SPRITE_SCALE = 0.625f;
|
||||||
|
|
||||||
protected DrawableSpinner DrawableSpinner { get; private set; }
|
protected DrawableSpinner DrawableSpinner { get; private set; }
|
||||||
@ -41,7 +48,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Texture = source.GetTexture("spinner-spin"),
|
Texture = source.GetTexture("spinner-spin"),
|
||||||
Scale = new Vector2(SPRITE_SCALE),
|
Scale = new Vector2(SPRITE_SCALE),
|
||||||
Y = LegacyCoordinatesContainer.SPINNER_TOP_OFFSET + 335,
|
Y = SPINNER_TOP_OFFSET + 335,
|
||||||
},
|
},
|
||||||
clear = new Sprite
|
clear = new Sprite
|
||||||
{
|
{
|
||||||
@ -50,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Texture = source.GetTexture("spinner-clear"),
|
Texture = source.GetTexture("spinner-clear"),
|
||||||
Scale = new Vector2(SPRITE_SCALE),
|
Scale = new Vector2(SPRITE_SCALE),
|
||||||
Y = LegacyCoordinatesContainer.SPINNER_TOP_OFFSET + 115,
|
Y = SPINNER_TOP_OFFSET + 115,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -136,13 +143,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected class LegacyCoordinatesContainer : Container
|
protected class LegacyCoordinatesContainer : Container
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// An offset that simulates stable's spinner top offset,
|
|
||||||
/// for positioning some legacy spinner components perfectly as in stable.
|
|
||||||
/// (e.g. 'spin' sprite, 'clear' sprite, metre in old-style spinners)
|
|
||||||
/// </summary>
|
|
||||||
public static readonly float SPINNER_TOP_OFFSET = (float)Math.Ceiling(45f * SPRITE_SCALE);
|
|
||||||
|
|
||||||
public LegacyCoordinatesContainer()
|
public LegacyCoordinatesContainer()
|
||||||
{
|
{
|
||||||
// legacy spinners relied heavily on absolute screen-space coordinate values.
|
// legacy spinners relied heavily on absolute screen-space coordinate values.
|
||||||
|
Reference in New Issue
Block a user