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); }
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; }
public void HandleInput(InputHelper inputHelper) { activeState.HandleInput(inputHelper); }
/// <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); }
public virtual void HandleInput(InputHelper inputHelper) { }