当前位置: 首页>>代码示例>>C#>>正文


C# GameScreen.Show方法代码示例

本文整理汇总了C#中GameScreen.Show方法的典型用法代码示例。如果您正苦于以下问题:C# GameScreen.Show方法的具体用法?C# GameScreen.Show怎么用?C# GameScreen.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameScreen的用法示例。


在下文中一共展示了GameScreen.Show方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandlestatusMenuScreen

 private void HandlestatusMenuScreen()
 {
     if (CheckKey(Keys.Back) || CheckKey(Keys.Escape))
     {
         activeScreen.Hide();
         activeScreen = ingameMenuScreen;
         activeScreen.Show();
     }
 }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:9,代码来源:ScreenManager.cs

示例2: QuitskillMenuScreen

 private void QuitskillMenuScreen()
 {
     skillScreen.menuOptionsActive = true;
     skillScreen.SelectActive = false;
     skillScreen.skillOptionsActive = false;
     skillScreen.QuickSlotActive = false;
     skillScreen.SelectedOption = 0;
     activeScreen.Hide();
     activeScreen = ingameMenuScreen;
     activeScreen.Show();
 }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:11,代码来源:ScreenManager.cs

示例3: HandleSelectCharScreen

        private void HandleSelectCharScreen()
        {
            if (CheckKey(Keys.Back) || CheckKey(Keys.Escape))
            {
                if (selectCharScreen.menu.EndIndex == 3)
                {
                    activeScreen.Hide();
                    activeScreen = startScreen;
                    activeScreen.Show();
                }
                else
                {
                    selectCharScreen.menu.SelectedIndex = 0;
                    selectCharScreen.menu.StartIndex = 0;
                    selectCharScreen.menu.EndIndex = 3;
                }
            }
            else if (CheckKey(Keys.Space) || CheckKey(Keys.Enter))
            {
                switch (selectCharScreen.SelectedIndex)
                {
                    case 0:
                        if (PlayerStore.Instance.Count > 0)
                        {
                            selectCharScreen.menu.StartIndex = 3;
                            selectCharScreen.menu.EndIndex = 5;
                        }
                        break;
                    case 1:
                        if (createCharScreen.initize())
                        {
                            selectCharScreen.menu.SelectedIndex = 0;
                            selectCharScreen.menu.StartIndex = 0;
                            selectCharScreen.menu.EndIndex = 3;
                            activeScreen.Hide();
                            activeScreen = createCharScreen;
                            activeScreen.Show();
                        }
                        break;
                    case 2:
                    case 3:
                        selectCharScreen.menu.SelectedIndex = 0;
                        selectCharScreen.menu.StartIndex = 0;
                        selectCharScreen.menu.EndIndex = 3;

                        GameWorld.GetInstance.LoadObjects(); // load client gameworld
                        GameWorld.GetInstance.ChangeJobClass(PlayerStore.Instance.activePlayer);

                        NetworkGameData.Instance.sendPlayerData("Online", PlayerStore.Instance.activePlayer);
                        NetworkGameData.Instance.sendScreenData("worldmap", "loading"); // inform server

                        activeScreen.Hide();
                        activeScreen = loadingScreen; // new
                        activeScreen.Show();

                        // the rest is handled by the TCPclient screendata

                        //NetworkGameData.Instance.sendPlayerData("Online", PlayerStore.Instance.activePlayer);
                        //activeScreen = actionScreen;
                        break;
                    case 4:
                        selectCharScreen.menu.SelectedIndex = 0;
                        selectCharScreen.menu.StartIndex = 0;
                        selectCharScreen.menu.EndIndex = 3;
                        activeScreen.Hide();
                        activeScreen = startScreen;
                        activeScreen.Show();
                        break;
                }
            }
        }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:71,代码来源:ScreenManager.cs

示例4: HandleStartScreenInput

 private void HandleStartScreenInput()
 {
     if (CheckKey(Keys.Enter) || CheckKey(Keys.Space))
     {
         switch (startScreen.SelectedIndex)
         {
             case 0:
                 activeScreen.Hide();
                 activeScreen = selectCharScreen;
                 activeScreen.Show();
                 break;
             case 1:
                 ingameMenuScreen.SelectedIndex = 0;
                 PlayerStore.Instance.loadPlayerStore("savegame.bin");
                 activeScreen.Hide();
                 activeScreen = selectCharScreen;
                 activeScreen.Show();
                 break;
             case 2:
                 activeScreen.Hide();
                 //activeScreen = helpScreen;
                 activeScreen = loginScreen;
                 activeScreen.Show();
                 break;
             case 3:
                 game.Exit();
                 break;
         }
     }
 }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:30,代码来源:ScreenManager.cs

示例5: HandleingameMenuInput

 private void HandleingameMenuInput()
 {
     if (CheckKey(Keys.Enter))
     {
         switch (ingameMenuScreen.SelectedIndex)
         {
             case 0:
                 activeScreen.Hide();
                 //itemMenuScreen.updateItemList(); // -> move to TCPClient itemData finish inventory
                 itemMenuScreen.ServerReqInventory();
                 activeScreen = itemMenuScreen;
                 activeScreen.Show();
                 break;
             case 1:
                 activeScreen.Hide();
                 activeScreen = skillScreen;
                 activeScreen.Show();
                 break;
             case 2:
                 activeScreen.Hide();
                 activeScreen = equipmentMenuScreen;
                 activeScreen.Show();
                 break;
             case 3:
                 activeScreen.Hide();
                 activeScreen = statusScreen;
                 activeScreen.Show();
                 break;
             case 4:
                 activeScreen.Hide();
                 activeScreen = startScreen;
                 ingameMenuScreen.SelectedIndex = 0;
                 PlayerStore.Instance.savePlayerStore("savegame.bin");
                 activeScreen.Show();
                 break;
             case 5:
                 activeScreen.Hide();
                 activeScreen = startScreen;
                 ingameMenuScreen.SelectedIndex = 0;
                 PlayerStore.Instance.loadPlayerStore("savegame.bin");
                 activeScreen.Show();
                 break;
             case 6:
                 activeScreen.Hide();
                 activeScreen = startScreen;
                 ingameMenuScreen.SelectedIndex = 0;
                 activeScreen.Show();
                 break;
         }
     }
     else if (CheckKey(Keys.Back) || CheckKey(Keys.Escape))
     {
         activeScreen.Hide();
         activeScreen = actionScreen;
         ingameMenuScreen.SelectedIndex = 0;
         activeScreen.Show();
     }
 }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:58,代码来源:ScreenManager.cs

示例6: HandleitemMenuScreen

 private void HandleitemMenuScreen()
 {
     if (CheckKey(Keys.Enter))
     {
         switch (ingameMenuScreen.SelectedIndex)
         {
             case 0:
             case 1:
             case 2:
             case 3:
             case 4:
             case 5:
                 break;
         }
     }
     else if (CheckKey(Keys.Back) || CheckKey(Keys.Escape))
     {
         if (!itemMenuScreen.serverRequest)
         {
             activeScreen.Hide();
             activeScreen = ingameMenuScreen;
             activeScreen.Show();
         }
     }
 }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:25,代码来源:ScreenManager.cs

示例7: HandleCreateCharScreen

        private void HandleCreateCharScreen()
        {
            if (CheckKey(Keys.Escape))
            {
                if (createCharScreen.phase == Phase.Name)
                {
                    activeScreen.Hide();
                    activeScreen = selectCharScreen;
                    activeScreen.Show();
                }
                else
                    createCharScreen.phase = Phase.Name;
            }

            if (CheckKey(Keys.Enter))
            {
                if (createCharScreen.phase == Phase.Properties)
                {
                    createCharScreen.phase = Phase.Name;
                    // PlayerStore.Instance.addPlayer(createCharScreen.newPlayer);
                    NetworkGameData.Instance.sendPlayerData("Create", createCharScreen.newPlayer); // new, send to server
                    activeScreen.Hide();
                    activeScreen = selectCharScreen;
                    activeScreen.Show();
                }
                else
                {
                    // check if name already exists
                    bool namematch = false;

                    for(int i = 0; i < PlayerStore.Instance.Count; i++)
                        if (createCharScreen.keyboardiput.Result == PlayerStore.Instance.playerlist[i].Name)
                            namematch = true;

                    if (!namematch) // no matches found
                    {
                        createCharScreen.phase = Phase.Properties;
                        createCharScreen.newPlayer.Name = createCharScreen.keyboardiput.Result;
                    }
                }
            }
        }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:42,代码来源:ScreenManager.cs

示例8: HandleHelpScreenInput

 private void HandleHelpScreenInput()
 {
     if (CheckKey(Keys.Space) ||
         CheckKey(Keys.Enter) ||
         CheckKey(Keys.Back) ||
         CheckKey(Keys.Escape))
     {
         activeScreen.Hide();
         activeScreen = startScreen;
         activeScreen.Show();
     }
 }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:12,代码来源:ScreenManager.cs

示例9: HandleActionScreenInput

 private void HandleActionScreenInput()
 {
     if (CheckKey(Keys.Tab) || CheckKey(Keys.Escape))
     {
         activeScreen.Hide();
         activeScreen = ingameMenuScreen;
         activeScreen.Show();
     }
 }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:9,代码来源:ScreenManager.cs

示例10: setScreen

        // manually set screen
        public void setScreen(string screenName)
        {
            activeScreen.Hide();

            //Type type = this.GetType().Assembly.GetType("XNA_ScreenManager.ScreenClasses." + screenName);
            //object instance = Activator.CreateInstance(type);
            //activeScreen = (GameScreen)instance;

            switch (screenName)
            {
                case "loginScreen":
                    activeScreen = loginScreen;
                    break;
                case "itemMenuScreen":
                    activeScreen = itemMenuScreen;
                    break;
                case "InGameMainMenuScreen":
                    activeScreen = ingameMenuScreen;
                    break;
                case "actionScreen":
                    activeScreen = actionScreen;
                    break;
                case "helpScreen":
                    activeScreen = helpScreen;
                    break;
                case "startScreen":
                    activeScreen = startScreen;
                    break;
                case "loadingScreen":
                    activeScreen = loadingScreen;
                    break;
                case "shopMenuScreen":
                    activeScreen = shopMenuScreen;
                    break;
                case "selectCharScreen":
                    activeScreen = selectCharScreen;
                    break;
            }

            activeScreen.Show();
        }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:42,代码来源:ScreenManager.cs

示例11: HandleStartScreenInput

 private void HandleStartScreenInput()
 {
     if (CheckKey(Keys.Enter) || CheckKey(Keys.Space))
     {
         switch (startScreen.SelectedIndex)
         {
             case 0:
                 activeScreen.Hide();
                 activeScreen = helpScreen;
                 activeScreen.Show();
                 break;
             case 1:
                 Exit();
                 break;
         }
     }
 }
开发者ID:BabbagesCabbages,项目名称:CSharpWork,代码行数:17,代码来源:Game.cs

示例12: LoadContent

        protected override void LoadContent()
        {
            ressource.loadcontent(Content);
            spriteBatch = new SpriteBatch(GraphicsDevice);

            gameover = new GameOverScreen(this, spriteBatch, ressource.ecriture, ressource.gameover);
            Components.Add(gameover);
            gameover.hide();

            edm = new EDM(this, spriteBatch);
            Components.Add(edm);
            edm.hide();

            pause = new menudepause(this, spriteBatch, ressource.ecriture, ressource.pixel);
            Components.Add(pause);
            pause.hide();

            menu = new menu(this, spriteBatch, Content.Load<SpriteFont>("SpriteFont"), ressource.templar);
            Components.Add(menu);
            menu.hide();

            menudujeu = new menudujeu(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.th);
            Components.Add(menudujeu);
            menudujeu.hide();

            option = new option(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.option);
            Components.Add(option);
            option.hide();

            main = new gamemain(this, spriteBatch, activeScreen);
            Components.Add(main);
            main.hide();

            activeScreen = menu;
            activeScreen.Show();

            MediaPlayer.Play(ressource.menu);
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = 0;

            SoundEffect.MasterVolume = 0.05f;

            ecran = false;
        }
开发者ID:tchiiikun,项目名称:Templar,代码行数:44,代码来源:Game1+(Copie+de+Alex+S+en+conflit+2013-01-16).cs

示例13: Update

        protected override void Update(GameTime gameTime)
        {
            /* timer_musique++;

            while (MediaPlayer.Volume != 10)
                if (timer_musique == 30)
                {
                    MediaPlayer.Volume++;
                    timer_musique = 0;
                }*/

            keyboard = Keyboard.GetState();

            # region gameover
            if (activeScreen == gameover)
            {
                if (checkKey(Keys.Enter))
                {
                    if (gameover.SelectedIndex == 0)
                    {

                    }

                    if (gameover.SelectedIndex == 1)
                    {
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = menu;
                        activeScreen.Show();
                    }

                    if (gameover.SelectedIndex == 2)
                    {
                        ressource.selection.Play();
                        this.Exit();
                    }

                }

            }
            #endregion

            #region screen_menu_principal

            if (activeScreen == menu)
            {
                if (checkKey(Keys.Enter))
                {
                    if (menu.SelectedIndex == 0)
                    {
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = menudujeu;
                        activeScreen.Show();
                    }

                    else if (menu.SelectedIndex == 1)
                    {

                    }

                    else if (menu.SelectedIndex == 2)
                    {
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = edm;
                        activeScreen.Show();
                    }

                    else if (menu.SelectedIndex == 3)
                    {
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = option;
                        activeScreen.Show();
                    }

                    else if (menu.SelectedIndex == 4)
                    {
                        ressource.selection.Play();
                        this.Exit();
                    }
                }
            }

            #endregion

            #region menu_1_Joueur

            else if (activeScreen == menudujeu)
            {
                if (checkKey(Keys.Enter))
                {

                    if (menudujeu.SelectedIndex == 0)
                    {
                        main = new gamemain(this, spriteBatch, activeScreen);
                        Components.Add(main);
                        main.hide();

//.........这里部分代码省略.........
开发者ID:tchiiikun,项目名称:Templar,代码行数:101,代码来源:Game1+(Copie+de+Alex+S+en+conflit+2013-01-16).cs


注:本文中的GameScreen.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。