コード例 #1
0
        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"));
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
ファイル: Debug.cs プロジェクト: MMBN-Engine/MMBN-Engine
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: Custom.cs プロジェクト: MMBN-Engine/MMBN-Engine
        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();
        }