public void Initialize(ContentManager content) { textures = new Dictionary <string, Texture2D>(); string path = "gfx/panels/"; List <String> fileArray = Scripting.getFilesFromFolder(path); foreach (string t in fileArray) { textures.Add(t, Scripting.loadImage(path + t + ".png")); } }
public static Dictionary <string, Texture2D> loadImageFolder(string path) { Dictionary <string, Texture2D> dictionary = new Dictionary <string, Texture2D>(); List <String> fileArray = Scripting.getFilesFromFolder(path); foreach (string t in fileArray) { dictionary.Add(t, loadImage(path + t + ".png")); } return(dictionary); }