コード例 #1
0
ファイル: InputManager.cs プロジェクト: srakowski/LD45
 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
ファイル: InputManager.cs プロジェクト: srakowski/LD45
 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;
 }