コード例 #1
0
        public InputHandler(Game game, bool allowsExiting = false)
            : base(game)
        {
            this.allowsExiting = allowsExiting;

            this.keyboard = new KeyboardHandler();
            this.gamePadHandler = new GamePadHandler();

            prevMouseState = Mouse.GetState();
            mouseState = prevMouseState;

            game.Services.AddService<IInputHandler>(this);                
        }
コード例 #2
0
 public Vector2 GetStick(int playerIndex, GamePadHandler.GamePadSticks stick)
 {
     return gamePadHandler.GetStick(playerIndex, stick);
 }