C# 클래스 GameStateManagement.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".
파일 보기 프로젝트 열기: GarethIW/LDEngine 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
CurrentKeyboardState Microsoft.Xna.Framework.Input.KeyboardState
CurrentMouseState Microsoft.Xna.Framework.Input.MouseState
LastKeyboardState KeyboardState
LastMouseState MouseState

공개 메소드들

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

Constructs a new input state.

IsMenuCancel ( ) : bool

Checks for a "menu cancel" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When the action is detected, the output playerIndex reports which player pressed it.

IsMenuDown ( ) : bool

Checks for a "menu down" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.

IsMenuLeft ( ) : bool
IsMenuRight ( ) : bool

Checks for a "menu down" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.

IsMenuSelect ( ) : bool

Checks for a "menu select" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When the action is detected, the output playerIndex reports which player pressed it.

IsMenuUp ( ) : bool

Checks for a "menu up" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.

IsNewKeyPress ( Keys key ) : 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.

IsPauseGame ( ) : bool

Checks for a "pause the game" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.

Update ( ) : void

Reads the latest state of the keyboard and gamepad.

메소드 상세

InputState() 공개 메소드

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

IsMenuCancel() 공개 메소드

Checks for a "menu cancel" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When the action is detected, the output playerIndex reports which player pressed it.
public IsMenuCancel ( ) : bool
리턴 bool

IsMenuDown() 공개 메소드

Checks for a "menu down" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.
public IsMenuDown ( ) : bool
리턴 bool

IsMenuLeft() 공개 메소드

public IsMenuLeft ( ) : bool
리턴 bool

IsMenuRight() 공개 메소드

Checks for a "menu down" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.
public IsMenuRight ( ) : bool
리턴 bool

IsMenuSelect() 공개 메소드

Checks for a "menu select" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player. When the action is detected, the output playerIndex reports which player pressed it.
public IsMenuSelect ( ) : bool
리턴 bool

IsMenuUp() 공개 메소드

Checks for a "menu up" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.
public IsMenuUp ( ) : bool
리턴 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 ) : bool
key Keys
리턴 bool

IsPauseGame() 공개 메소드

Checks for a "pause the game" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.
public IsPauseGame ( ) : bool
리턴 bool

Update() 공개 메소드

Reads the latest state of the keyboard and gamepad.
public Update ( ) : void
리턴 void

프로퍼티 상세

CurrentKeyboardState 공개적으로 프로퍼티

public KeyboardState,Microsoft.Xna.Framework.Input CurrentKeyboardState
리턴 Microsoft.Xna.Framework.Input.KeyboardState

CurrentMouseState 공개적으로 프로퍼티

public MouseState,Microsoft.Xna.Framework.Input CurrentMouseState
리턴 Microsoft.Xna.Framework.Input.MouseState

LastKeyboardState 공개적으로 프로퍼티

public KeyboardState LastKeyboardState
리턴 KeyboardState

LastMouseState 공개적으로 프로퍼티

public MouseState LastMouseState
리턴 MouseState