C# Класс Nez.GamePadData

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
isLeftStickVertcialInverted bool
isRightStickVertcialInverted bool

Открытые методы

Метод Описание
getLeftStick ( ) : Vector2
getLeftStick ( float deadzone ) : Vector2
getLeftTriggerRaw ( ) : float
getRightStick ( ) : Vector2
getRightStick ( float deadzone ) : Vector2
getRightTriggerRaw ( ) : float
isButtonDown ( Buttons button ) : bool

true the entire time the button is down

isButtonPressed ( Buttons button ) : bool

only true if down this frame

isButtonReleased ( Buttons button ) : bool

true only the frame the button is released

isConnected ( ) : bool

returns true if this game pad is connected

isLeftStickDown ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isLeftStickDownPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool

true only the frame the stick passes the deadzone in the direction

isLeftStickLeft ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isLeftStickLeftPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool

true only the frame the stick passes the deadzone in the direction

isLeftStickRight ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isLeftStickRightPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool

true only the frame the stick passes the deadzone in the direction

isLeftStickUp ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isLeftStickUpPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool

true only the frame the stick passes the deadzone in the direction

isLeftTriggerDown ( float threshold = 0.2f ) : bool

true whenever the trigger is down past the threshold

isLeftTriggerPressed ( float threshold = 0.2f ) : bool

true only the frame that the trigger passed the threshold

isLeftTriggerReleased ( float threshold = 0.2f ) : bool

true the frame the trigger is released

isRightStickDown ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isRightStickLeft ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isRightStickRight ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isRightStickUp ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
isRightTriggerDown ( float threshold = 0.2f ) : bool

true whenever the trigger is down past the threshold

isRightTriggerPressed ( float threshold = 0.2f ) : bool

true only the frame that the trigger passed the threshold

isRightTriggerReleased ( float threshold = 0.2f ) : bool

true the frame the trigger is released

setVibration ( float left, float right, float duration ) : void
stopVibration ( ) : void
update ( ) : void

Приватные методы

Метод Описание
GamePadData ( PlayerIndex playerIndex ) : Microsoft.Xna.Framework

Описание методов

getLeftStick() публичный Метод

public getLeftStick ( ) : Vector2
Результат Vector2

getLeftStick() публичный Метод

public getLeftStick ( float deadzone ) : Vector2
deadzone float
Результат Vector2

getLeftTriggerRaw() публичный Метод

public getLeftTriggerRaw ( ) : float
Результат float

getRightStick() публичный Метод

public getRightStick ( ) : Vector2
Результат Vector2

getRightStick() публичный Метод

public getRightStick ( float deadzone ) : Vector2
deadzone float
Результат Vector2

getRightTriggerRaw() публичный Метод

public getRightTriggerRaw ( ) : float
Результат float

isButtonDown() публичный Метод

true the entire time the button is down
public isButtonDown ( Buttons button ) : bool
button Buttons Button.
Результат bool

isButtonPressed() публичный Метод

only true if down this frame
public isButtonPressed ( Buttons button ) : bool
button Buttons Button.
Результат bool

isButtonReleased() публичный Метод

true only the frame the button is released
public isButtonReleased ( Buttons button ) : bool
button Buttons Button.
Результат bool

isConnected() публичный Метод

returns true if this game pad is connected
public isConnected ( ) : bool
Результат bool

isLeftStickDown() публичный Метод

public isLeftStickDown ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isLeftStickDownPressed() публичный Метод

true only the frame the stick passes the deadzone in the direction
public isLeftStickDownPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
Результат bool

isLeftStickLeft() публичный Метод

public isLeftStickLeft ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isLeftStickLeftPressed() публичный Метод

true only the frame the stick passes the deadzone in the direction
public isLeftStickLeftPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
Результат bool

isLeftStickRight() публичный Метод

public isLeftStickRight ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isLeftStickRightPressed() публичный Метод

true only the frame the stick passes the deadzone in the direction
public isLeftStickRightPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
Результат bool

isLeftStickUp() публичный Метод

public isLeftStickUp ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isLeftStickUpPressed() публичный Метод

true only the frame the stick passes the deadzone in the direction
public isLeftStickUpPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
Результат bool

isLeftTriggerDown() публичный Метод

true whenever the trigger is down past the threshold
public isLeftTriggerDown ( float threshold = 0.2f ) : bool
threshold float Threshold.
Результат bool

isLeftTriggerPressed() публичный Метод

true only the frame that the trigger passed the threshold
public isLeftTriggerPressed ( float threshold = 0.2f ) : bool
threshold float Threshold.
Результат bool

isLeftTriggerReleased() публичный Метод

true the frame the trigger is released
public isLeftTriggerReleased ( float threshold = 0.2f ) : bool
threshold float Threshold.
Результат bool

isRightStickDown() публичный Метод

public isRightStickDown ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isRightStickLeft() публичный Метод

public isRightStickLeft ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isRightStickRight() публичный Метод

public isRightStickRight ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isRightStickUp() публичный Метод

public isRightStickUp ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
Результат bool

isRightTriggerDown() публичный Метод

true whenever the trigger is down past the threshold
public isRightTriggerDown ( float threshold = 0.2f ) : bool
threshold float Threshold.
Результат bool

isRightTriggerPressed() публичный Метод

true only the frame that the trigger passed the threshold
public isRightTriggerPressed ( float threshold = 0.2f ) : bool
threshold float Threshold.
Результат bool

isRightTriggerReleased() публичный Метод

true the frame the trigger is released
public isRightTriggerReleased ( float threshold = 0.2f ) : bool
threshold float Threshold.
Результат bool

setVibration() публичный Метод

public setVibration ( float left, float right, float duration ) : void
left float
right float
duration float
Результат void

stopVibration() публичный Метод

public stopVibration ( ) : void
Результат void

update() публичный Метод

public update ( ) : void
Результат void

Описание свойств

isLeftStickVertcialInverted публичное свойство

toggles inverting the left sticks vertical value
public bool isLeftStickVertcialInverted
Результат bool

isRightStickVertcialInverted публичное свойство

toggles inverting the right sticks vertical value
public bool isRightStickVertcialInverted
Результат bool