示例#1
0
        protected virtual void HandleInput(InputHelper inputHelper)
        {
            if (inputHelper.KeyPressed(Keys.Escape))
                this.Exit();
            if (inputHelper.KeyPressed(Keys.F5))
            {
                graphics.IsFullScreen = !graphics.IsFullScreen;
                graphics.PreferredBackBufferWidth = graphics.IsFullScreen ? 1920 : 1280;
                graphics.PreferredBackBufferHeight = graphics.IsFullScreen ? 1080 : 720;
                graphics.ApplyChanges();
                Mouse.SetPosition(Screen.X / 2, Screen.Y / 2);
            }

            gameStateManager.HandleInput(inputHelper);
        }
示例#2
0
        protected override void LoadContent()
        {
            contentManager = Content;
            gd = GraphicsDevice;
            gameWindow = Window;
            Random = new Random();
            inputHelper = new InputHelper();
            spriteBatch = new SpriteBatch(GraphicsDevice);
            gameStateManager = new GameStateManager();

            PerspectiveMatrix = Matrix.CreatePerspectiveFieldOfView((float)Math.PI / 4.0f,
                (float)Screen.X / (float)Screen.Y,
                NearPlane, FarPlane);

            rasterizerState = RasterizerState.CullCounterClockwise;
            //RasterizerState rs = new RasterizerState();
            //rs.CullMode = CullMode.CullCounterClockwiseFace;
            //rs.FillMode = FillMode.WireFrame;
            //rasterizerState = rs;
        }
示例#3
0
 public void HandleInput(InputHelper inputHelper)
 {
     activeState.HandleInput(inputHelper);
 }
示例#4
0
 /// <summary>
 /// Calls HandleInout for all objects in this GameState.
 /// </summary>
 /// <param name="inputHelper">An object required for handling player input.</param>
 public virtual void HandleInput(InputHelper inputHelper)
 {
     gameObjects.HandleInput(inputHelper);
 }
 public void HandleInput(InputHelper inputHelper)
 {
     currentGameState?.HandleInput(inputHelper);
 }
示例#6
0
 public virtual void HandleInput(InputHelper inputHelper)
 {
 }