示例#1
0
 public override void Update(GameTime gameTime)
 {
     CenterScreen = Game.GraphicsDevice.Viewport.Bounds.Center.ToVector2();
     Keyboard     = Keyboard.Next(KB.GetState());
     Mouse        = Mouse.Next(MS.GetState());
     UpdateGamePadState(PlayerIndex.One);
     UpdateGamePadState(PlayerIndex.Two);
     UpdateGamePadState(PlayerIndex.Three);
     UpdateGamePadState(PlayerIndex.Four);
 }
示例#2
0
 public InputManager(Game game, Engine engine) : base(game)
 {
     _engine = engine;
     game.Components.Add(this);
     Keyboard = new InputStates <KeyboardState>();
     Mouse    = new InputStates <MouseState>();
     GamePads = new InputStates <GamePadState>[]
     {
         new InputStates <GamePadState>(),
         new InputStates <GamePadState>(),
         new InputStates <GamePadState>(),
         new InputStates <GamePadState>(),
     };
     Game.Window.TextInput += Window_TextInput;
 }