mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add SkinnableSprite implementation
This commit is contained in:
25
osu.Game/Skinning/SkinnableSprite.cs
Normal file
25
osu.Game/Skinning/SkinnableSprite.cs
Normal file
@ -0,0 +1,25 @@
|
||||
// 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 osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
public class SkinnableSprite : SkinnableDrawable<Sprite>
|
||||
{
|
||||
protected override bool ApplySizeToDefault => true;
|
||||
|
||||
protected override Sprite CreateDefault(string name) => new Sprite { Texture = textures.Get(name) };
|
||||
|
||||
[Resolved]
|
||||
private TextureStore textures { get; set; }
|
||||
|
||||
public SkinnableSprite(string name, Func<ISkinSource, bool> allowFallback = null, bool restrictSize = true)
|
||||
: base(name, allowFallback, restrictSize)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user