private void button62_Click(object sender, EventArgs e)
        {
            if (selectedAnimation.texFileLoc.Equals(""))
            {
                MessageBox.Show("Please select base texture file.");
                OpenFileDialog openTex = new OpenFileDialog();
                openTex.Title = "Open texture file";
                if (Game1.bIsDebug)
                {
                    openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg;*.xnb";
                    openTex.InitialDirectory = Game1.rootContent;
                }
                else
                {
                    openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg";
                    openTex.InitialDirectory = Game1.rootContentExtra;
                }

                bool bDone = false;

                while (!bDone)
                {
                    DialogResult dia = openTex.ShowDialog();
                    if (dia == DialogResult.OK && openTex.FileName.Contains(openTex.InitialDirectory))
                    {
                        selectedAnimation.texFileLoc = openTex.FileName.Replace(Game1.rootContent, "").Substring(0, openTex.FileName.Replace(Game1.rootContent, "").LastIndexOf("."));
                        Console.WriteLine("Successful item texture selection");
                        bDone = true;
                    }
                    else if (!openTex.FileName.Contains(openTex.InitialDirectory))
                    {
                        MessageBox.Show(@"Please select a file within the application folder under Content\Mods and it's subfolders");
                    }
                    else if (dia == DialogResult.Cancel)
                    {
                        bDone = true;
                    }
                }
            }


            try
            {
                selectedAnimation.ReloadTexture();
                FrameSelector.StartComplex(selectedAnimation, (int)frameWidth.Value, (int)frameHeight.Value, (int)-xOffSet.Value, (int)yOffSet.Value);
            }
            catch
            {
            }
        }
예제 #2
0
        public StartScreen()
        {
            BattleGUI.InitializeResources();
            bIsRunning    = true;
            r2d           = new RenderTarget2D(Game1.graphics.GraphicsDevice, 1366, 768);
            bg.texFileLoc = @"Graphics\StartScreen\StartBG";
            bg.animationFrames.Add(new Rectangle(0, 0, 1366, 768));
            bg.ReloadTexture();

            sf = Game1.contentManager.Load <SpriteFont>(@"Fonts\Design\BGUI\test48");
            //testSF = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test");
            //testSF20 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test20");
            //testSF25 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test25");
            //testSF32 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test32");
            //testSF48 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test48");
            int width  = 800;
            int deltaH = 28;
            int height = (400 - deltaH * 5) / 4;

            Rectangle b = new Rectangle((1366 - width) / 2, 400, 800, height);

            mButtons.Add(new SCButton(b, sf, "New Game"));
            b.Y += height + deltaH;
            mButtons.Add(new SCButton(b, sf, "Load Game"));
            b.Y += height + deltaH;
            mButtons.Add(new SCButton(b, sf, "Settings"));
            b.Y += height + deltaH;
            mButtons.Add(new SCButton(b, sf, "Exit Game"));
            sc = this;

            Utilities.Control.Player.PlayerController.InitializeStartScreenControls(this);
        }
 public void ReloadTexture()
 {
     try
     {
         abilityIcon.ReloadTexture();
     }
     catch
     {
     }
 }
        private void button3_Click(object sender, EventArgs e)
        {
            if (seoColl != null && sheetTex != null)
            {
                generatedSources = new List <TileSource>();
                generatedObjects = new List <BaseSprite>();

                foreach (var item in seoColl.lseo)
                {
                    if (item.spriteObjectType == SpriteExportObject.spriteType.Tile)
                    {
                        TileSource ts = new TileSource();
                        ts.tileName                      = item.name;
                        ts.tileAnimation                 = new ShapeAnimation();
                        ts.tileAnimation.texFileLoc      = texLoc;
                        ts.tileAnimation.animationFrames = new List <Microsoft.Xna.Framework.Rectangle>(item.animationFrames);
                        ts.tileAnimation.ReloadTexture();
                        generatedSources.Add(ts);
                    }

                    if (item.spriteObjectType == SpriteExportObject.spriteType.Object)
                    {
                        BaseSprite ts = new BaseSprite();
                        ts.shapeName = item.name;
                        ShapeAnimation temp = new ShapeAnimation();
                        temp.texFileLoc      = texLoc;
                        temp.animationFrames = new List <Microsoft.Xna.Framework.Rectangle>(item.animationFrames);
                        temp.ReloadTexture();
                        ts.baseAnimations.Add(temp);
                        ts.spriteGameSize = new Microsoft.Xna.Framework.Rectangle(0, 0, item.width, item.height);
                        generatedObjects.Add(ts);
                        MapBuilder.gcDB.AddObject(ts);
                    }
                }

                foreach (var item in generatedSources)
                {
                    MapBuilder.gcDB.AddTile(item);
                }

                this.Close();
            }
        }
예제 #5
0
 public void ReloadTextures()
 {
     tileAnimation.ReloadTexture();
     ResetAnimation();
 }
예제 #6
0
 public void ReloadTexture()
 {
     itemTexAndAnimation.texFileLoc = itemTexLoc;
     itemTexAndAnimation.ReloadTexture();
 }
예제 #7
0
 public override void ReloadTextures()
 {
     base.ReloadTextures();
     lightOffAnim.ReloadTexture();
     lightMask.ReloadTexture();
 }