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); }
void loadSongsFromFile() { songList = new Dictionary <string, Song>(); ScriptState state = Scripting.parse("Content/music/songs.txt"); ScriptVariable v = state.Variables[0]; PropertyInfo[] p = v.Value.GetType().GetProperties(); for (int i = 0; i < p.GetLength(0); i++) { string s = (string)Scripting.getScriptValue(p[i].Name, v); songList.Add(p[i].Name, Content.Load <Song>(s)); } }
public void debugContent() { //Content.Load<Texture2D>("sprites/navi/megaman/aqua").saveTexture("aqua2"); //List<Color> Null = Content.Load<Texture2D>("sprites/navi/megaman/null").getPalette(); //List<Color> Elec = Content.Load<Texture2D>("sprites/navi/megaman/elec").getPalette(); //Content.Load<Texture2D>("sprites/navi/megaman/team").changeColor(Elec,Null).saveImage("team"); //Texture2D test = Scripting.loadImage("gfx/navi/MegaMan/attacks/shoot2.png"); //Texture2D test2 = Scripting.loadImage("gfx/navi/MegaMan/attacks/test.png"); //test = test.changeColor(test2.getPalette(), navi.palettes["Null"]); Scripting.loadImage("gfx/navi/NormalNavi/navi.png").saveTexture("Null"); //Stream stream = File.OpenWrite("shoot3.png"); //test.SaveAsPng(stream, test.Width, test.Height); }
public static Dictionary <object, object> getObjectsFromFile(string filepath, string keyField) { filepath = Game.modulePath + filepath; ScriptState state = Scripting.parse(filepath); List <ScriptVariable> vlist = state.Variables.ToList(); //Remove entries that start with an underscore vlist.RemoveAll(v => v.Name[0] == '_'); Dictionary <object, object> dictionary = new Dictionary <object, object>(); foreach (ScriptVariable v in vlist) { dictionary.Add(getScriptValue(keyField, v), v.Value); } return(dictionary); }
public void Initialize(ContentManager content, Navi navi) { screen = content.Load <Texture2D>("sprites/custom/custom-screen"); hpDisplay = content.Load <Texture2D>("sprites/custom/hp-screen"); bar = content.Load <Texture2D>("sprites/custom/custom-bar"); color = content.Load <Texture2D>("sprites/custom/bar-color"); elemIcons = Scripting.loadImageFolder("gfx/custom/icons/"); loadFonts(content); chipCancel = content.Load <SoundEffect>("soundFX/custom/chipCancel"); chipChoose = content.Load <SoundEffect>("soundFX/custom/chipChoose"); chipConfirm = content.Load <SoundEffect>("soundFX/custom/chipConfirm"); chipSelect = content.Load <SoundEffect>("soundFX/custom/chipSelect"); custBarFull = content.Load <SoundEffect>("soundFX/custom/custBarFull"); customScreenOpen = content.Load <SoundEffect>("soundFX/custom/customScreenOpen"); redHPSound = content.Load <SoundEffect>("soundFX/custom/redHP"); redHPInstance = redHPSound.CreateInstance(); redHPInstance.IsLooped = true; full.Initialize(content.Load <Texture2D>("sprites/custom/custom-full"), new Vector2(0, 0), 147, 180, true); cursor.Initialize(content.Load <Texture2D>("sprites/custom/cursor"), new Vector2(2, 2), 18, 40, true); cursorOK.Initialize(content.Load <Texture2D>("sprites/custom/cursorOK"), new Vector2(2, -8), 26, 40, true); cursorAdd.Initialize(content.Load <Texture2D>("sprites/custom/cursorAdd"), new Vector2(2, -7), 25, 40, true); this.navi = navi; resetChipArray(); }