Moved Assets.bf. Sprites loading

This commit is contained in:
Maddy Thorson 2021-02-02 18:08:32 -08:00
parent 80c6cf0799
commit 621b044748
2 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@ namespace Strawberry
static public class Assets
{
static public Dictionary<String, Texture> Textures { get; private set; }
static public Dictionary<String, Sprite> Sprites { get; private set; }
#if DEBUG
static public readonly String Root = "../../../src/assets/";
@ -28,13 +29,17 @@ namespace Strawberry
static public void LoadAll()
{
Textures = new Dictionary<String, Texture>();
Textures = new .();
Load<Texture>("textures", "*.png", Textures, (path) => Game.PlatformLayer.LoadTexture(path));
Sprites = new .();
Load<Sprite>("sprites", "*.ase", Sprites, (path) => { return new Sprite(new String(path)); });
}
static public void DisposeAll()
{
DeleteDictionaryAndKeysAndValues!(Textures);
DeleteDictionaryAndKeysAndValues!(Sprites);
Sprite.[Friend]Dispose();
}

View File

@ -18,7 +18,7 @@ namespace Strawberry
private List<Slice> slices;
private Modes mode;
private this(String path)
public this(String path)
: base(path)
{
Load();