Example #1
0
        private bool isStart; // for sound
        public override void Init(Game _game)
        {
            base.Init(_game);
            isStart      = true; //for sound
            offsetButton = new Point(10, 0);

            //Background
            menuBackground = new Sprite(Game.Content, "Menu\\MenuBackground");

            //Button
            duleModeBtn = new Button(new Sprite(Game.Content, "Menu\\Button\\DuelMode_Normal"), new Sprite(Game.Content, "Menu\\Button\\DuelMode_Hover"));
            //duleModeBtn.Position = new Vector2(0, 0);
            duleModeBtn.Position     = Vector2.Zero;
            duleModeBtn.ButtonEvent += gotoDuelScene;

            cardListBtn          = new Button(new Sprite(Game.Content, "Menu\\Button\\CardList_Normal"), new Sprite(Game.Content, "Menu\\Button\\CardList_Hover"));
            cardListBtn.Position = new Vector2(duleModeBtn.Position.X + duleModeBtn.Sprite.Size.X + offsetButton.X, duleModeBtn.Position.Y);

            deckEditorBtn          = new Button(new Sprite(Game.Content, "Menu\\Button\\DeckEditor_Normal"), new Sprite(Game.Content, "Menu\\Button\\DeckEditor_Hover"));
            deckEditorBtn.Position = new Vector2(cardListBtn.Position.X + cardListBtn.Sprite.Size.X + offsetButton.X, +cardListBtn.Position.Y);

            optionBtn          = new Button(new Sprite(Game.Content, "Menu\\Button\\Option_Normal"), new Sprite(Game.Content, "Menu\\Button\\Option_Hover"));
            optionBtn.Position = new Vector2(deckEditorBtn.Position.X + deckEditorBtn.Sprite.Size.X + offsetButton.X, deckEditorBtn.Position.Y);

            quitBtn                 = new Button(new Sprite(Game.Content, "Menu\\Button\\Quit_Normal"), new Sprite(Game.Content, "Menu\\Button\\Quit_Hover"));
            quitBtn.Position        = new Vector2(optionBtn.Position.X + optionBtn.Sprite.Size.X + offsetButton.X, optionBtn.Position.Y);
            quitBtn.ButtonEvent    += new Action(quitButton);
            menuBackground.Position = new Vector2(0, 0);
        }
Example #2
0
        public override void Init(Game _game)
        {
            base.Init(_game);
            isStart = true;	//for sound
            offsetButton = new Point(10, 0);

            //Background
            menuBackground = new Sprite(Game.Content, "Menu\\MenuBackground");

            //Button
            duleModeBtn = new Button(new Sprite(Game.Content, "Menu\\Button\\DuelMode_Normal"), new Sprite(Game.Content, "Menu\\Button\\DuelMode_Hover"));
            //duleModeBtn.Position = new Vector2(0, 0);
            duleModeBtn.Position = Vector2.Zero;
            duleModeBtn.ButtonEvent += gotoDuelScene;

            cardListBtn = new Button(new Sprite(Game.Content, "Menu\\Button\\CardList_Normal"), new Sprite(Game.Content, "Menu\\Button\\CardList_Hover"));
            cardListBtn.Position = new Vector2(duleModeBtn.Position.X + duleModeBtn.Sprite.Size.X + offsetButton.X, duleModeBtn.Position.Y);

            deckEditorBtn = new Button(new Sprite(Game.Content, "Menu\\Button\\DeckEditor_Normal"), new Sprite(Game.Content, "Menu\\Button\\DeckEditor_Hover"));
            deckEditorBtn.Position = new Vector2(cardListBtn.Position.X + cardListBtn.Sprite.Size.X + offsetButton.X, + cardListBtn.Position.Y);

            optionBtn = new Button(new Sprite(Game.Content, "Menu\\Button\\Option_Normal"), new Sprite(Game.Content, "Menu\\Button\\Option_Hover"));
            optionBtn.Position = new Vector2(deckEditorBtn.Position.X + deckEditorBtn.Sprite.Size.X + offsetButton.X, deckEditorBtn.Position.Y);

            quitBtn = new Button(new Sprite(Game.Content, "Menu\\Button\\Quit_Normal"), new Sprite(Game.Content, "Menu\\Button\\Quit_Hover"));
            quitBtn.Position = new Vector2(optionBtn.Position.X + optionBtn.Sprite.Size.X + offsetButton.X, optionBtn.Position.Y);
            quitBtn.ButtonEvent += new Action(quitButton);
            menuBackground.Position = new Vector2(0, 0);
        }