コード例 #1
0
        private void BtnPlayAgain_Click(object sender, EventArgs e)
        {
            this.Close();
            ActualGame.Close();
            FrmGame newGame = new FrmGame(MenuUI);

            newGame.Show();
        }
コード例 #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            base.LoadContent();
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here

            mainMenuBackground    = this.Content.Load <Texture2D>("MainMenu");
            settingMenuBackground = this.Content.Load <Texture2D>("SettingsPage");
            lostPage = this.Content.Load <Texture2D>("LossPage");
            wonPage  = this.Content.Load <Texture2D>("WinPage");
            Cursor   = this.Content.Load <Texture2D>("Cursor");
            inputDef = InputDefinitions.CreateInput(this);

            MouseKeyboard keyboard = new MouseKeyboard(this);

            mK = new MouseKeyboard(this);

            canv = new Canvas(this);
            ss   = new StyleSheet();
            canv.Initialize();

            if (!File.Exists("MainMenu.ss"))
            {
                GenerateStyleSheet("MainMenu");
            }
            if (!File.Exists("SettingsPage.ss"))
            {
                GenerateStyleSheet("SettingsPage");
            }
            if (!File.Exists("EndScreen.ss"))
            {
                GenerateStyleSheet("EndScreen");
            }
            LoadCanvas("MainMenu.ss", 0);
            currentPage = "Main Menu";

            PlayedGame = new ActualGame(this, "World");
        }
コード例 #3
0
 private void BtnQuit_Click(object sender, EventArgs e)
 {
     this.Close();
     ActualGame.Close();
     MenuUI.Close();
 }
コード例 #4
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     ActualGame.Close();
 }