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 scale adjusts to bring legacy skins in-line with lazer sizing #2256

Merged
merged 3 commits into from Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 15 additions & 2 deletions osu.Game/Skinning/LegacySkin.cs
Expand Up @@ -11,6 +11,7 @@
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using osu.Game.Database;
using OpenTK;

namespace osu.Game.Skinning
{
Expand Down Expand Up @@ -56,10 +57,22 @@ public override Drawable GetDrawableComponent(string componentName)
break;
}

var texture = GetTexture(componentName);
float ratio = 0.72f; // brings sizing roughly in-line with stable

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.


var texture = GetTexture($"{componentName}@2x");
if (texture == null)
{
ratio *= 2;
GetTexture(componentName);
}

if (texture == null) return null;

return new Sprite { Texture = texture };
return new Sprite
{
Texture = texture,
Scale = new Vector2(ratio),
};
}

public override Texture GetTexture(string componentName) => Textures.Get(componentName);
Expand Down
1 change: 1 addition & 0 deletions osu.Game/Skinning/SkinnableDrawable.cs
Expand Up @@ -49,6 +49,7 @@ protected override void SkinChanged(ISkinSource skin, bool allowFallback)
{
drawable.RelativeSizeAxes = Axes.Both;
drawable.Size = Vector2.One;
drawable.Scale = Vector2.One;
drawable.FillMode = FillMode.Fit;
}
}
Expand Down