C# Class Nez.GamePadData

ファイルを表示 Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
isLeftStickVertcialInverted bool
isRightStickVertcialInverted bool

Public Methods

Method Description
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

Private Methods

Method Description
GamePadData ( PlayerIndex playerIndex ) : Microsoft.Xna.Framework

Method Details

getLeftStick() public method

public getLeftStick ( ) : Vector2
return Vector2

getLeftStick() public method

public getLeftStick ( float deadzone ) : Vector2
deadzone float
return Vector2

getLeftTriggerRaw() public method

public getLeftTriggerRaw ( ) : float
return float

getRightStick() public method

public getRightStick ( ) : Vector2
return Vector2

getRightStick() public method

public getRightStick ( float deadzone ) : Vector2
deadzone float
return Vector2

getRightTriggerRaw() public method

public getRightTriggerRaw ( ) : float
return float

isButtonDown() public method

true the entire time the button is down
public isButtonDown ( Buttons button ) : bool
button Buttons Button.
return bool

isButtonPressed() public method

only true if down this frame
public isButtonPressed ( Buttons button ) : bool
button Buttons Button.
return bool

isButtonReleased() public method

true only the frame the button is released
public isButtonReleased ( Buttons button ) : bool
button Buttons Button.
return bool

isConnected() public method

returns true if this game pad is connected
public isConnected ( ) : bool
return bool

isLeftStickDown() public method

public isLeftStickDown ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isLeftStickDownPressed() public method

true only the frame the stick passes the deadzone in the direction
public isLeftStickDownPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
return bool

isLeftStickLeft() public method

public isLeftStickLeft ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isLeftStickLeftPressed() public method

true only the frame the stick passes the deadzone in the direction
public isLeftStickLeftPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
return bool

isLeftStickRight() public method

public isLeftStickRight ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isLeftStickRightPressed() public method

true only the frame the stick passes the deadzone in the direction
public isLeftStickRightPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
return bool

isLeftStickUp() public method

public isLeftStickUp ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isLeftStickUpPressed() public method

true only the frame the stick passes the deadzone in the direction
public isLeftStickUpPressed ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float Deadzone.
return bool

isLeftTriggerDown() public method

true whenever the trigger is down past the threshold
public isLeftTriggerDown ( float threshold = 0.2f ) : bool
threshold float Threshold.
return bool

isLeftTriggerPressed() public method

true only the frame that the trigger passed the threshold
public isLeftTriggerPressed ( float threshold = 0.2f ) : bool
threshold float Threshold.
return bool

isLeftTriggerReleased() public method

true the frame the trigger is released
public isLeftTriggerReleased ( float threshold = 0.2f ) : bool
threshold float Threshold.
return bool

isRightStickDown() public method

public isRightStickDown ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isRightStickLeft() public method

public isRightStickLeft ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isRightStickRight() public method

public isRightStickRight ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isRightStickUp() public method

public isRightStickUp ( float deadzone = Input.DEFAULT_DEADZONE ) : bool
deadzone float
return bool

isRightTriggerDown() public method

true whenever the trigger is down past the threshold
public isRightTriggerDown ( float threshold = 0.2f ) : bool
threshold float Threshold.
return bool

isRightTriggerPressed() public method

true only the frame that the trigger passed the threshold
public isRightTriggerPressed ( float threshold = 0.2f ) : bool
threshold float Threshold.
return bool

isRightTriggerReleased() public method

true the frame the trigger is released
public isRightTriggerReleased ( float threshold = 0.2f ) : bool
threshold float Threshold.
return bool

setVibration() public method

public setVibration ( float left, float right, float duration ) : void
left float
right float
duration float
return void

stopVibration() public method

public stopVibration ( ) : void
return void

update() public method

public update ( ) : void
return void

Property Details

isLeftStickVertcialInverted public_oe property

toggles inverting the left sticks vertical value
public bool isLeftStickVertcialInverted
return bool

isRightStickVertcialInverted public_oe property

toggles inverting the right sticks vertical value
public bool isRightStickVertcialInverted
return bool