C# Class Nez.VirtualButton

A virtual input that is represented as a boolean. As well as simply checking the current button state, you can ask whether it was just pressed or released this frame. You can also keep the button press stored in a buffer for a limited time, or until it is consumed by calling consumeBuffer()
Inheritance: VirtualInput
显示文件 Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
bufferTime float
firstRepeatTime float
multiRepeatTime float
nodes List

Public Methods

Method Description
VirtualButton ( ) : System.Collections.Generic
VirtualButton ( float bufferTime ) : System.Collections.Generic
addGamePadButton ( int gamepadIndex, Buttons button ) : VirtualButton

adds a GamePad buttons press to this VirtualButton

addGamePadDPad ( int gamepadIndex, Direction direction ) : VirtualButton

adds a GamePad DPad press to this VirtualButton

addGamePadLeftTrigger ( int gamepadIndex, float threshold ) : VirtualButton

adds a GamePad left trigger press to this VirtualButton

addGamePadRightTrigger ( int gamepadIndex, float threshold ) : VirtualButton

adds a GamePad right trigger press to this VirtualButton

addKeyboardKey ( Keys key ) : VirtualButton

adds a keyboard key to this VirtualButton

addKeyboardKey ( Keys key, Keys modifier ) : VirtualButton

adds a keyboard key with modifier to this VirtualButton. modifier must be in the down state for isPressed/isDown to be true.

addMouseLeftButton ( ) : VirtualButton

adds a left mouse click to this VirtualButton

addMouseRightButton ( ) : VirtualButton

adds a right mouse click to this VirtualButton

consumeBuffer ( ) : void
setRepeat ( float repeatTime ) : void
setRepeat ( float firstRepeatTime, float multiRepeatTime ) : void
update ( ) : void

Method Details

VirtualButton() public method

public VirtualButton ( ) : System.Collections.Generic
return System.Collections.Generic

VirtualButton() public method

public VirtualButton ( float bufferTime ) : System.Collections.Generic
bufferTime float
return System.Collections.Generic

addGamePadButton() public method

adds a GamePad buttons press to this VirtualButton
public addGamePadButton ( int gamepadIndex, Buttons button ) : VirtualButton
gamepadIndex int Gamepad index.
button Buttons Button.
return VirtualButton

addGamePadDPad() public method

adds a GamePad DPad press to this VirtualButton
public addGamePadDPad ( int gamepadIndex, Direction direction ) : VirtualButton
gamepadIndex int Gamepad index.
direction Direction Direction.
return VirtualButton

addGamePadLeftTrigger() public method

adds a GamePad left trigger press to this VirtualButton
public addGamePadLeftTrigger ( int gamepadIndex, float threshold ) : VirtualButton
gamepadIndex int Gamepad index.
threshold float Threshold.
return VirtualButton

addGamePadRightTrigger() public method

adds a GamePad right trigger press to this VirtualButton
public addGamePadRightTrigger ( int gamepadIndex, float threshold ) : VirtualButton
gamepadIndex int Gamepad index.
threshold float Threshold.
return VirtualButton

addKeyboardKey() public method

adds a keyboard key to this VirtualButton
public addKeyboardKey ( Keys key ) : VirtualButton
key Keys Key.
return VirtualButton

addKeyboardKey() public method

adds a keyboard key with modifier to this VirtualButton. modifier must be in the down state for isPressed/isDown to be true.
public addKeyboardKey ( Keys key, Keys modifier ) : VirtualButton
key Keys Key.
modifier Keys Modifier.
return VirtualButton

addMouseLeftButton() public method

adds a left mouse click to this VirtualButton
public addMouseLeftButton ( ) : VirtualButton
return VirtualButton

addMouseRightButton() public method

adds a right mouse click to this VirtualButton
public addMouseRightButton ( ) : VirtualButton
return VirtualButton

consumeBuffer() public method

public consumeBuffer ( ) : void
return void

setRepeat() public method

public setRepeat ( float repeatTime ) : void
repeatTime float
return void

setRepeat() public method

public setRepeat ( float firstRepeatTime, float multiRepeatTime ) : void
firstRepeatTime float
multiRepeatTime float
return void

update() public method

public update ( ) : void
return void

Property Details

bufferTime public_oe property

public float bufferTime
return float

firstRepeatTime public_oe property

public float firstRepeatTime
return float

multiRepeatTime public_oe property

public float multiRepeatTime
return float

nodes public_oe property

public List nodes
return List