C# 클래스 TraceRacer.InputState

Helper for reading input from keyboard, gamepad, and touch input. This class tracks both the current and previous state of the input devices, and implements query methods for high level input actions such as "move up through the menu" or "pause the game".
파일 보기 프로젝트 열기: alexcoco/trace_racer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
CurrentGamePadStates Microsoft.Xna.Framework.Input.GamePadState[]
CurrentKeyboardStates Microsoft.Xna.Framework.Input.KeyboardState[]
GamePadWasConnected bool[]
Gestures List
LastGamePadStates Microsoft.Xna.Framework.Input.GamePadState[]
LastKeyboardStates Microsoft.Xna.Framework.Input.KeyboardState[]
TouchState TouchCollection

공개 메소드들

메소드 설명
InputState ( ) : System.Collections.Generic

Constructs a new input state.

IsButtonPressed ( Buttons button, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool

Helper for checking if a button was pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a button press is detected, the output playerIndex reports which player pressed it.

IsKeyPressed ( Keys key, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool

Helper for checking if a key was pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a keypress is detected, the output playerIndex reports which player pressed it.

IsNewButtonPress ( Buttons button, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool

Helper for checking if a button was newly pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a button press is detected, the output playerIndex reports which player pressed it.

IsNewKeyPress ( Keys key, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool

Helper for checking if a key was newly pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a keypress is detected, the output playerIndex reports which player pressed it.

Update ( ) : void

Reads the latest state user input.

메소드 상세

InputState() 공개 메소드

Constructs a new input state.
public InputState ( ) : System.Collections.Generic
리턴 System.Collections.Generic

IsButtonPressed() 공개 메소드

Helper for checking if a button was pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a button press is detected, the output playerIndex reports which player pressed it.
public IsButtonPressed ( Buttons button, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool
button Buttons
controllingPlayer PlayerIndex
playerIndex PlayerIndex
리턴 bool

IsKeyPressed() 공개 메소드

Helper for checking if a key was pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a keypress is detected, the output playerIndex reports which player pressed it.
public IsKeyPressed ( Keys key, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool
key Keys
controllingPlayer PlayerIndex
playerIndex PlayerIndex
리턴 bool

IsNewButtonPress() 공개 메소드

Helper for checking if a button was newly pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a button press is detected, the output playerIndex reports which player pressed it.
public IsNewButtonPress ( Buttons button, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool
button Buttons
controllingPlayer PlayerIndex
playerIndex PlayerIndex
리턴 bool

IsNewKeyPress() 공개 메소드

Helper for checking if a key was newly pressed during this update. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When a keypress is detected, the output playerIndex reports which player pressed it.
public IsNewKeyPress ( Keys key, PlayerIndex controllingPlayer, PlayerIndex &playerIndex ) : bool
key Keys
controllingPlayer PlayerIndex
playerIndex PlayerIndex
리턴 bool

Update() 공개 메소드

Reads the latest state user input.
public Update ( ) : void
리턴 void

프로퍼티 상세

CurrentGamePadStates 공개적으로 프로퍼티

public GamePadState[],Microsoft.Xna.Framework.Input CurrentGamePadStates
리턴 Microsoft.Xna.Framework.Input.GamePadState[]

CurrentKeyboardStates 공개적으로 프로퍼티

public KeyboardState[],Microsoft.Xna.Framework.Input CurrentKeyboardStates
리턴 Microsoft.Xna.Framework.Input.KeyboardState[]

GamePadWasConnected 공개적으로 프로퍼티

public bool[] GamePadWasConnected
리턴 bool[]

Gestures 공개적으로 프로퍼티

public List Gestures
리턴 List

LastGamePadStates 공개적으로 프로퍼티

public GamePadState[],Microsoft.Xna.Framework.Input LastGamePadStates
리턴 Microsoft.Xna.Framework.Input.GamePadState[]

LastKeyboardStates 공개적으로 프로퍼티

public KeyboardState[],Microsoft.Xna.Framework.Input LastKeyboardStates
리턴 Microsoft.Xna.Framework.Input.KeyboardState[]

TouchState 공개적으로 프로퍼티

public TouchCollection TouchState
리턴 TouchCollection