Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maximum dimensions limit to skinnable gameplay elements #24706

Merged
merged 23 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2c81fe5
Make gameplay skin elements in `special-skin` awfully large
frenzibyte Sep 1, 2023
6674c70
Add support for limiting skin texture/animation dimensions
frenzibyte Sep 2, 2023
351081e
Add limit to osu! hit circle elements
frenzibyte Sep 2, 2023
d286816
Add limit to taiko hit elements
frenzibyte Sep 2, 2023
f182f57
Add limit to catch palpable object elements
frenzibyte Sep 2, 2023
96f12cf
Update `GetTexture` signature rather than creating new overload
peppy Sep 5, 2023
9d17539
Add size limitations for taiko drum rolls
peppy Sep 5, 2023
57dc76b
Revert "Update `GetTexture` signature rather than creating new overload"
frenzibyte Sep 19, 2023
291a91b
Change extension from retrieval to post-processing instead
frenzibyte Sep 19, 2023
a373d71
Add basic test scene upscaling all skin elements
frenzibyte Sep 19, 2023
fc1a39e
Add size limitations for slider balls
frenzibyte Sep 19, 2023
f963a92
Add size limitation for slider follow circle
frenzibyte Sep 19, 2023
b823507
Add size limitation for approach circles
frenzibyte Sep 19, 2023
ab52268
Add size limitation for slider reverse arrow piece
frenzibyte Sep 19, 2023
922f6f3
Add size limitation for hit object numbers
frenzibyte Sep 19, 2023
8f5d1b5
Revert "Make gameplay skin elements in `special-skin` awfully large"
frenzibyte Sep 19, 2023
8e16b1d
Simplify some maximum size specs
peppy Sep 20, 2023
bd66285
Rename parameter on `LegacySpriteText` to better imply the maximum si…
peppy Sep 20, 2023
1316403
Fix inspection in new test scene
peppy Sep 20, 2023
c4fc419
Use correct maximum size for droplets
frenzibyte Sep 21, 2023
ad86bf2
Revert redundant size limitations
frenzibyte Sep 21, 2023
b1561b6
Rename test scene, add xmldoc and increase scale factor to something …
peppy Sep 26, 2023
990c545
Merge branch 'master' into limit-gameplay-sprite-dimensions
peppy Sep 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyBananaPiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Textures;
using osu.Game.Skinning;
using osuTK;

namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
public partial class LegacyBananaPiece : LegacyCatchHitObjectPiece
{
private static readonly Vector2 banana_max_size = new Vector2(128);

protected override void LoadComplete()
{
base.LoadComplete();

Texture? texture = Skin.GetTexture("fruit-bananas");
Texture? overlayTexture = Skin.GetTexture("fruit-bananas-overlay");
Texture? texture = Skin.GetTexture("fruit-bananas")?.WithMaximumSize(banana_max_size);
Texture? overlayTexture = Skin.GetTexture("fruit-bananas-overlay")?.WithMaximumSize(banana_max_size);

SetTexture(texture, overlayTexture);
}
Expand Down
7 changes: 5 additions & 2 deletions osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyDropletPiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Textures;
using osu.Game.Skinning;
using osuTK;

namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
public partial class LegacyDropletPiece : LegacyCatchHitObjectPiece
{
private static readonly Vector2 droplet_max_size = new Vector2(100);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does 100 come from? The template skin is 82 x 103 (@1x).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to say it's correct, but I think I picked 100 as it's closest to 103...I'll change to 82x103


public LegacyDropletPiece()
{
Scale = new Vector2(0.8f);
Expand All @@ -17,8 +20,8 @@ protected override void LoadComplete()
{
base.LoadComplete();

Texture? texture = Skin.GetTexture("fruit-drop");
Texture? overlayTexture = Skin.GetTexture("fruit-drop-overlay");
Texture? texture = Skin.GetTexture("fruit-drop")?.WithMaximumSize(droplet_max_size);
Texture? overlayTexture = Skin.GetTexture("fruit-drop-overlay")?.WithMaximumSize(droplet_max_size);

SetTexture(texture, overlayTexture);
}
Expand Down
12 changes: 8 additions & 4 deletions osu.Game.Rulesets.Catch/Skinning/Legacy/LegacyFruitPiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Skinning;
using osuTK;

namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
internal partial class LegacyFruitPiece : LegacyCatchHitObjectPiece
{
private static readonly Vector2 fruit_max_size = new Vector2(128);

protected override void LoadComplete()
{
base.LoadComplete();
Expand All @@ -22,19 +26,19 @@ private void setTexture(FruitVisualRepresentation visualRepresentation)
switch (visualRepresentation)
{
case FruitVisualRepresentation.Pear:
SetTexture(Skin.GetTexture("fruit-pear"), Skin.GetTexture("fruit-pear-overlay"));
SetTexture(Skin.GetTexture("fruit-pear")?.WithMaximumSize(fruit_max_size), Skin.GetTexture("fruit-pear-overlay")?.WithMaximumSize(fruit_max_size));
break;

case FruitVisualRepresentation.Grape:
SetTexture(Skin.GetTexture("fruit-grapes"), Skin.GetTexture("fruit-grapes-overlay"));
SetTexture(Skin.GetTexture("fruit-grapes")?.WithMaximumSize(fruit_max_size), Skin.GetTexture("fruit-grapes-overlay")?.WithMaximumSize(fruit_max_size));
break;

case FruitVisualRepresentation.Pineapple:
SetTexture(Skin.GetTexture("fruit-apple"), Skin.GetTexture("fruit-apple-overlay"));
SetTexture(Skin.GetTexture("fruit-apple")?.WithMaximumSize(fruit_max_size), Skin.GetTexture("fruit-apple-overlay")?.WithMaximumSize(fruit_max_size));
break;

case FruitVisualRepresentation.Raspberry:
SetTexture(Skin.GetTexture("fruit-orange"), Skin.GetTexture("fruit-orange-overlay"));
SetTexture(Skin.GetTexture("fruit-orange")?.WithMaximumSize(fruit_max_size), Skin.GetTexture("fruit-orange-overlay")?.WithMaximumSize(fruit_max_size));
break;
}
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
public partial class LegacyMainCirclePiece : CompositeDrawable
{
private static readonly Vector2 circle_piece_size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);

public override bool RemoveCompletedTransforms => false;

/// <summary>
Expand Down Expand Up @@ -51,7 +53,7 @@ public LegacyMainCirclePiece(string? priorityLookupPrefix = null, bool hasNumber
this.priorityLookupPrefix = priorityLookupPrefix;
this.hasNumber = hasNumber;

Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
Size = circle_piece_size;
}

[BackgroundDependencyLoader]
Expand All @@ -68,7 +70,7 @@ private void load()
// expected behaviour in this scenario is not showing the overlay, rather than using hitcircleoverlay.png.
InternalChildren = new[]
{
CircleSprite = new LegacyKiaiFlashingDrawable(() => new Sprite { Texture = skin.GetTexture(circleName) })
CircleSprite = new LegacyKiaiFlashingDrawable(() => new Sprite { Texture = skin.GetTexture(circleName)?.WithMaximumSize(circle_piece_size) })
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Expand All @@ -77,7 +79,7 @@ private void load()
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Child = OverlaySprite = new LegacyKiaiFlashingDrawable(() => skin.GetAnimation(@$"{circleName}overlay", true, true, frameLength: 1000 / 2d))
Child = OverlaySprite = new LegacyKiaiFlashingDrawable(() => skin.GetAnimation(@$"{circleName}overlay", true, true, frameLength: 1000 / 2d, maxSize: circle_piece_size))
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions osu.Game.Rulesets.Taiko/Skinning/Legacy/LegacyCirclePiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
{
public partial class LegacyCirclePiece : CompositeDrawable, IHasAccentColour
{
private static readonly Vector2 circle_piece_size = new Vector2(128);

private Drawable backgroundLayer = null!;
private Drawable? foregroundLayer;

Expand Down Expand Up @@ -52,9 +54,9 @@ private void load(ISkinSource skin, DrawableHitObject drawableHitObject, IBeatSy

string prefix = ((drawableHitObject.HitObject as TaikoStrongableHitObject)?.IsStrong ?? false) ? big_hit : normal_hit;

return skin.GetAnimation($"{prefix}{lookup}", true, false) ??
return skin.GetAnimation($"{prefix}{lookup}", true, false, maxSize: circle_piece_size) ??
// fallback to regular size if "big" version doesn't exist.
skin.GetAnimation($"{normal_hit}{lookup}", true, false);
skin.GetAnimation($"{normal_hit}{lookup}", true, false, maxSize: circle_piece_size);
}

// backgroundLayer is guaranteed to exist due to the pre-check in TaikoLegacySkinTransformer.
Expand Down Expand Up @@ -96,7 +98,7 @@ protected override void Update()
// Not all skins (including the default osu-stable) have similar sizes for "hitcircle" and "hitcircleoverlay".
// This ensures they are scaled relative to each other but also match the expected DrawableHit size.
foreach (var c in InternalChildren)
c.Scale = new Vector2(DrawHeight / 128);
c.Scale = new Vector2(DrawHeight / circle_piece_size.Y);

if (foregroundLayer is IFramedAnimation animatableForegroundLayer)
animateForegroundLayer(animatableForegroundLayer);
Expand Down
5 changes: 3 additions & 2 deletions osu.Game.Rulesets.Taiko/Skinning/Legacy/LegacyDrumRoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
Expand Down Expand Up @@ -47,13 +48,13 @@ private void load(ISkinSource skin, OsuColour colours)
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.Both,
Texture = skin.GetTexture("taiko-roll-end", WrapMode.ClampToEdge, WrapMode.ClampToEdge),
Texture = skin.GetTexture("taiko-roll-end", WrapMode.ClampToEdge, WrapMode.ClampToEdge)?.WithMaximumSize(new Vector2(128, 256)),
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these 256 based, not 128?

Also adjusting this doesn't affect the test scene at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhh...9d17539

And yes, adjusting doesn't affect because the sprite is resized regardless of the texture, see #24706 (comment).

FillMode = FillMode.Fit,
},
body = new Sprite
{
RelativeSizeAxes = Axes.Both,
Texture = skin.GetTexture("taiko-roll-middle", WrapMode.ClampToEdge, WrapMode.ClampToEdge),
Texture = skin.GetTexture("taiko-roll-middle", WrapMode.ClampToEdge, WrapMode.ClampToEdge)?.WithMaximumSize(new Vector2(2, 256)),
},
headCircle = new LegacyCirclePiece
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// 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 System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Textures;
using osu.Framework.Testing;
using osu.Game.IO;
using osu.Game.Rulesets;
using osu.Game.Screens.Play;
using osu.Game.Skinning;

namespace osu.Game.Tests.Visual.Gameplay
{
public partial class TestSceneGameplayElementDimensions : TestSceneAllRulesetPlayers
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What on earth is this naming..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I...don't know?

{
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));

// for now this only applies to legacy skins, as modern skins don't have texture-based gameplay elements yet.
dependencies.CacheAs<ISkinSource>(new UpscaledLegacySkin(dependencies.Get<SkinManager>()));

return dependencies;
}

protected override void AddCheckSteps()
{
}

protected override Player CreatePlayer(Ruleset ruleset)
{
var player = base.CreatePlayer(ruleset);
player.OnLoadComplete += _ =>
{
// this test scene focuses on gameplay elements, so let's hide the hud.
var hudOverlay = player.ChildrenOfType<HUDOverlay>().Single();
hudOverlay.ShowHud.Value = false;
hudOverlay.ShowHud.Disabled = true;
};
return player;
}

private class UpscaledLegacySkin : DefaultLegacySkin, ISkinSource
{
public UpscaledLegacySkin(IStorageResourceProvider resources)
: base(resources)
{
}

public event Action? SourceChanged
{
add { }
remove { }
}

public override Texture? GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT)
{
var texture = base.GetTexture(componentName, wrapModeS, wrapModeT);

if (texture != null)
texture.ScaleAdjust /= 5f;

return texture;
}

public ISkin? FindProvider(Func<ISkin, bool> lookupFunction) => this;

Check failure on line 69 in osu.Game.Tests/Visual/Gameplay/TestSceneGameplayElementDimensions.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Return type of 'FindProvider' can be non-nullable in osu.Game.Tests\Visual\Gameplay\TestSceneGameplayElementDimensions.cs on line 69
public IEnumerable<ISkin> AllSources => new[] { this };
}
}
}
3 changes: 2 additions & 1 deletion osu.Game/Skinning/IAnimationTimeReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics.Textures;
using osu.Framework.Timing;
using osuTK;

namespace osu.Game.Skinning
{
Expand All @@ -13,7 +14,7 @@ namespace osu.Game.Skinning
/// </summary>
/// <remarks>
/// This should not be used to start an animation immediately at the current time.
/// To do so, use <see cref="LegacySkinExtensions.GetAnimation(ISkin, string, WrapMode, WrapMode, bool, bool, bool, string, bool, double?)"/> with <code>startAtCurrentTime = true</code> instead.
/// To do so, use <see cref="LegacySkinExtensions.GetAnimation(ISkin, string, WrapMode, WrapMode, bool, bool, bool, string, bool, double?, Vector2?)"/> with <code>startAtCurrentTime = true</code> instead.
/// </remarks>
[Cached]
public interface IAnimationTimeReference
Expand Down
31 changes: 24 additions & 7 deletions osu.Game/Skinning/LegacySkinExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osuTK;
using static osu.Game.Skinning.SkinConfiguration;

namespace osu.Game.Skinning
{
public static partial class LegacySkinExtensions
{
public static Drawable? GetAnimation(this ISkin? source, string componentName, bool animatable, bool looping, bool applyConfigFrameRate = false, string animationSeparator = "-",
bool startAtCurrentTime = true, double? frameLength = null)
=> source.GetAnimation(componentName, default, default, animatable, looping, applyConfigFrameRate, animationSeparator, startAtCurrentTime, frameLength);
bool startAtCurrentTime = true, double? frameLength = null, Vector2? maxSize = null)
=> source.GetAnimation(componentName, default, default, animatable, looping, applyConfigFrameRate, animationSeparator, startAtCurrentTime, frameLength, maxSize);

public static Drawable? GetAnimation(this ISkin? source, string componentName, WrapMode wrapModeS, WrapMode wrapModeT, bool animatable, bool looping, bool applyConfigFrameRate = false,
string animationSeparator = "-", bool startAtCurrentTime = true, double? frameLength = null)
string animationSeparator = "-", bool startAtCurrentTime = true, double? frameLength = null, Vector2? maxSize = null)
{
if (source == null)
return null;

var textures = GetTextures(source, componentName, wrapModeS, wrapModeT, animatable, animationSeparator, out var retrievalSource);
var textures = GetTextures(source, componentName, wrapModeS, wrapModeT, animatable, animationSeparator, maxSize, out var retrievalSource);

switch (textures.Length)
{
Expand All @@ -53,7 +54,7 @@ public static partial class LegacySkinExtensions
}
}

public static Texture[] GetTextures(this ISkin? source, string componentName, WrapMode wrapModeS, WrapMode wrapModeT, bool animatable, string animationSeparator, out ISkin? retrievalSource)
public static Texture[] GetTextures(this ISkin? source, string componentName, WrapMode wrapModeS, WrapMode wrapModeT, bool animatable, string animationSeparator, Vector2? maxSize, out ISkin? retrievalSource)
{
retrievalSource = null;

Expand All @@ -80,6 +81,9 @@ public static Texture[] GetTextures(this ISkin? source, string componentName, Wr
// if an animation was not allowed or not found, fall back to a sprite retrieval.
var singleTexture = retrievalSource.GetTexture(componentName, wrapModeS, wrapModeT);

if (singleTexture != null && maxSize != null)
singleTexture = singleTexture.WithMaximumSize(maxSize.Value);

return singleTexture != null
? new[] { singleTexture }
: Array.Empty<Texture>();
Expand All @@ -88,18 +92,31 @@ IEnumerable<Texture> getTextures(ISkin skin)
{
for (int i = 0; true; i++)
{
Texture? texture;
var texture = skin.GetTexture(getFrameName(i), wrapModeS, wrapModeT);

if ((texture = skin.GetTexture(getFrameName(i), wrapModeS, wrapModeT)) == null)
if (texture == null)
break;

if (maxSize != null)
texture = texture.WithMaximumSize(maxSize.Value);

yield return texture;
}
}

string getFrameName(int frameIndex) => $"{componentName}{animationSeparator}{frameIndex}";
}

public static Texture WithMaximumSize(this Texture texture, Vector2 maxSize)
{
if (texture.DisplayWidth <= maxSize.X && texture.DisplayHeight <= maxSize.Y)
return texture;

// use scale adjust property for downscaling the texture in order to meet the specified maximum dimensions.
texture.ScaleAdjust *= Math.Max(texture.DisplayWidth / maxSize.X, texture.DisplayHeight / maxSize.Y);
Comment on lines +115 to +116
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to have to be very conscious about this, to ensure we don't have any local usages overriding ScaleAdjust themselves.

I've checked all usages in the project right now and it seems okay. For now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a second thought, an alternative way to achieve this could be to have something like a "maximum texture size" property in SkinnableSprite, and if the sprite exceeds that property then the scale of it is adjusted accordingly.

That might be better as to avoid tinkering around with low properties like Texture.ScaleAdjust. Also saves from having to add extra properties to GetTexture/GetAnimation. @peppy thoughts? would it be worth the effort?

return texture;
}

public static bool HasFont(this ISkin source, LegacyFont font)
{
return source.GetTexture($"{source.GetFontPrefix(font)}-0") != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private void skinSourceChanged()

// When reading from a skin, we match stables weird behaviour where `FrameCount` is ignored
// and resources are retrieved until the end of the animation.
foreach (var texture in skin.GetTextures(Path.GetFileNameWithoutExtension(Animation.Path)!, default, default, true, string.Empty, out _))
foreach (var texture in skin.GetTextures(Path.GetFileNameWithoutExtension(Animation.Path)!, default, default, true, string.Empty, null, out _))
AddFrame(texture, Animation.FrameDelay);
}

Expand Down