mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2024-11-28 16:58:56 +08:00
Moved Assets.bf. Sprites loading
This commit is contained in:
parent
80c6cf0799
commit
621b044748
|
@ -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();
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ namespace Strawberry
|
|||
private List<Slice> slices;
|
||||
private Modes mode;
|
||||
|
||||
private this(String path)
|
||||
public this(String path)
|
||||
: base(path)
|
||||
{
|
||||
Load();
|
||||
|
|
Loading…
Reference in New Issue
Block a user