ShowScreen() публичный Метод

Show a screen
public ShowScreen ( Screen screen ) : bool
screen Screen Screen to show
Результат bool
Пример #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            //Setup some basic input
            inputManager = new InputManager();
            inputManager.AddInput(InputAction.Selection, Keys.Enter);
            inputManager.AddInput(InputAction.Selection, Buttons.A);
            inputManager.AddInput(InputAction.Selection, Buttons.Start);

            //Menu Actions
            inputManager.AddInput(InputAction.MenuUp, Keys.Up);
            inputManager.AddInput(InputAction.MenuDown, Keys.Down);
            inputManager.AddInput(InputAction.MenuLeft, Keys.Left);
            inputManager.AddInput(InputAction.MenuRight, Keys.Right);
            inputManager.AddInput(InputAction.MenuSelect, Keys.Enter);
            inputManager.AddInput(InputAction.MenuCancel, Keys.Back);

            inputManager.AddInput(InputAction.MenuUp, Buttons.LeftThumbstickUp);
            inputManager.AddInput(InputAction.MenuDown, Buttons.LeftThumbstickDown);
            inputManager.AddInput(InputAction.MenuLeft, Buttons.LeftThumbstickLeft);
            inputManager.AddInput(InputAction.MenuRight, Buttons.LeftThumbstickRight);
            inputManager.AddInput(InputAction.MenuUp, Buttons.DPadUp);
            inputManager.AddInput(InputAction.MenuDown, Buttons.DPadDown);
            inputManager.AddInput(InputAction.MenuLeft, Buttons.DPadLeft);
            inputManager.AddInput(InputAction.MenuRight, Buttons.DPadRight);
            inputManager.AddInput(InputAction.MenuSelect, Buttons.A);
            inputManager.AddInput(InputAction.MenuCancel, Buttons.B);

            inputManager.AddInput(InputAction.ExitGame, Buttons.Back);
            inputManager.AddInput(InputAction.ExitGame, Keys.Escape);

            this.Services.AddService(typeof(InputManager), inputManager);

            //Movement Actions
            inputManager.AddInput(InputAction.TileMoveUp, Keys.T);
            inputManager.AddInput(InputAction.TileMoveDown, Keys.G);
            inputManager.AddInput(InputAction.TileMoveLeft, Keys.F);
            inputManager.AddInput(InputAction.TileMoveRight, Keys.H);

            inputManager.AddInput(InputAction.TileMoveUp, Buttons.LeftThumbstickUp);
            inputManager.AddInput(InputAction.TileMoveDown, Buttons.LeftThumbstickDown);
            inputManager.AddInput(InputAction.TileMoveLeft, Buttons.LeftThumbstickLeft);
            inputManager.AddInput(InputAction.TileMoveRight, Buttons.LeftThumbstickRight);

            //Tower Action
            inputManager.AddInput(InputAction.TowerBuild, Keys.Space);
            inputManager.AddInput(InputAction.TowerBuild, Buttons.A);
            inputManager.AddInput(InputAction.TowerDestroy, Keys.B);
            inputManager.AddInput(InputAction.TowerDestroy, Buttons.B);
            inputManager.AddInput(InputAction.TowerRepair, Keys.N);
            inputManager.AddInput(InputAction.TowerRepair, Buttons.Y);
            inputManager.AddInput(InputAction.TowerUpgrade, Keys.M);
            inputManager.AddInput(InputAction.TowerUpgrade, Buttons.X);

            //PlayerMenu
            inputManager.AddInput(InputAction.PlayerMenuLeft, Buttons.DPadLeft);
            inputManager.AddInput(InputAction.PlayerMenuRight, Buttons.DPadRight);
            inputManager.AddInput(InputAction.PlayerMenuUp, Buttons.DPadUp);
            inputManager.AddInput(InputAction.PlayerMenuDown, Buttons.DPadDown);
            inputManager.AddInput(InputAction.PlayerMenuLeft, Keys.J);
            inputManager.AddInput(InputAction.PlayerMenuRight, Keys.L);
            inputManager.AddInput(InputAction.PlayerMenuUp, Keys.I);
            inputManager.AddInput(InputAction.PlayerMenuDown, Keys.K);

            //UnitAction
            inputManager.AddInput(InputAction.UnitBuild, Buttons.RightTrigger);
            inputManager.AddInput(InputAction.UnitBuild, Keys.U);
            inputManager.AddInput(InputAction.UnitLeft, Buttons.RightThumbstickLeft);
            inputManager.AddInput(InputAction.UnitRight, Buttons.RightThumbstickRight);
            inputManager.AddInput(InputAction.UnitUp, Buttons.RightThumbstickUp);
            inputManager.AddInput(InputAction.UnitDown, Buttons.RightThumbstickDown);
            inputManager.AddInput(InputAction.UnitLeft, Keys.A);
            inputManager.AddInput(InputAction.UnitRight, Keys.D);
            inputManager.AddInput(InputAction.UnitUp, Keys.W);
            inputManager.AddInput(InputAction.UnitDown, Keys.S);

            //GameLobby
            inputManager.AddInput(InputAction.StartGame, Buttons.X);
            inputManager.AddInput(InputAction.BackToMainMenu, Buttons.Y);
            inputManager.AddInput(InputAction.JoinGame, Buttons.A);
            inputManager.AddInput(InputAction.TeamUp, Buttons.LeftThumbstickUp);
            inputManager.AddInput(InputAction.TeamDown, Buttons.LeftThumbstickDown);
            inputManager.AddInput(InputAction.TeamUp, Buttons.DPadUp);
            inputManager.AddInput(InputAction.TeamUp, Buttons.DPadDown);
            inputManager.AddInput(InputAction.StartGame, Keys.X);
            inputManager.AddInput(InputAction.BackToMainMenu, Keys.Y);
            inputManager.AddInput(InputAction.JoinGame, Keys.A);
            inputManager.AddInput(InputAction.TeamUp, Keys.Up);
            inputManager.AddInput(InputAction.TeamDown, Keys.Down);

            inputManager.AddInput(InputAction.HUD, Buttons.LeftStick);
            inputManager.AddInput(InputAction.HUD, Keys.H);

            inputManager.AddInput(InputAction.PickEnemyTarget, Buttons.LeftShoulder);
            inputManager.AddInput(InputAction.PickEnemyTarget, Keys.Q);

            inputManager.AddInput(InputAction.TowerInformation, Buttons.RightShoulder);
            inputManager.AddInput(InputAction.TowerInformation, Keys.P);

            inputManager.AddInput(InputAction.Pause, Buttons.Start);
            inputManager.AddInput(InputAction.Pause, Keys.Z);

            inputManager.AddInput(InputAction.PowerActivate, Buttons.LeftTrigger);
            inputManager.AddInput(InputAction.PowerActivate, Keys.A);

            //Setup Screen Manager
            screenManager = new ScreenManager(this);
            this.Services.AddService(typeof(ScreenManager), screenManager);

            //Setup Camera
            cameraManager = new CameraManager();
            this.Services.AddService(typeof(CameraManager), cameraManager);

            //Set Starting Screen
            screenManager.ShowScreen(new IntroScreen());
        }
Пример #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()
        {
            //Setup some basic input
            inputManager = new InputManager();
            inputManager.AddInput(InputAction.Selection, Keys.Enter);
            inputManager.AddInput(InputAction.Rotation, Keys.Space);
            inputManager.AddInput(InputAction.RotateUp, Keys.Up);
            inputManager.AddInput(InputAction.RotateUp, Keys.I);
            inputManager.AddInput(InputAction.RotateDown, Keys.Down);
            inputManager.AddInput(InputAction.RotateLeft, Keys.Left);
            inputManager.AddInput(InputAction.RotateRight, Keys.Right);
            inputManager.AddInput(InputAction.StrafeUp, Keys.W);
            inputManager.AddInput(InputAction.StrafeDown, Keys.S);
            inputManager.AddInput(InputAction.StrafeLeft, Keys.A);
            inputManager.AddInput(InputAction.StrafeRight, Keys.D);

            //Menu Actions
            inputManager.AddInput(InputAction.MenuUp, Keys.Up);
            inputManager.AddInput(InputAction.MenuDown, Keys.Down);
            inputManager.AddInput(InputAction.MenuSelect, Keys.Enter);
            inputManager.AddInput(InputAction.MenuCancel, Keys.Back);
            this.Services.AddService(typeof(InputManager), inputManager);

            //Movement Actions
            inputManager.AddInput(InputAction.TileMoveUp, Keys.T);
            inputManager.AddInput(InputAction.TileMoveDown, Keys.G);
            inputManager.AddInput(InputAction.TileMoveLeft, Keys.F);
            inputManager.AddInput(InputAction.TileMoveRight, Keys.H);

            //Tower Action
            inputManager.AddInput(InputAction.TowerBuild, Keys.Space);

            //Setup Screen Manager
            screenManager = new ScreenManager(this);

            //Setup Camera
            cameraManager = new CameraManager();
            this.Services.AddService(typeof(CameraManager), cameraManager);

            //Set Starting Screen
            screenManager.ShowScreen(new MenuScreenTest());
        }