mirror of
				https://github.com/MaddyThorson/StrawberryBF.git
				synced 2025-11-04 01:41:33 +08:00 
			
		
		
		
	Moved Assets.bf. Sprites loading
This commit is contained in:
		@ -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();
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user