C# Class Project2.InputManager

This class handles all user input for the game, implemented as a system.
Inheritance: SharpDX.Toolkit.GameSystem
Mostra file Open project: nuclearpidgeon/graphicsproj2 Class Usage Examples

Public Properties

Property Type Description
gestureRecognizer Windows.UI.Input.GestureRecognizer
mouseClick System.Boolean
window Windows.UI.Core.CoreWindow

Private Properties

Property Type Description
OnPointerMoved void
OnPointerPressed void
OnPointerReleased void

Public Methods

Method Description
Acceleration ( ) : System.Vector3

Get the acceleration data from sensor input as of last update.

AccelerometerEnabled ( System.Boolean t ) : void

Used to set the enable state of the accelerometer. When the accelerometer is disabled, the acceleration data returned is a zero vector.

InputManager ( Project2Game game ) : System

Initialise the input system. Note that accelerometer input defaults to off.

IsKeyDown ( Keys key ) : System.Boolean

Check if Key is pressed.

Jump ( ) : System.Boolean

Helper method to determine if there is an input that should be interpreted as a "jump" command.

MouseDelta ( ) : System.Vector2

Get a non-normalised vector representing the direction of mouse movement since the last frame;

MouseDeltaEnabled ( System.Boolean t ) : void

Enable capturing of mouse cursor and mouse delta data.

MousePosition ( ) : System.Vector2

Get the raw mouse position

MouseState ( ) : SharpDX.Toolkit.Input.MouseState

Get the raw mouse state;

PauseRequest ( ) : bool

Helper method to determine the player has requested a new pause or unpause event

PointerState ( ) : SharpDX.Toolkit.Input.PointerState

Get the raw pointer state;

PrimaryDirection ( ) : System.Vector3

Helper method to return primary directional input vector

SecondaryDirection ( ) : System.Vector3

Helper method to return secondary directional input vector

SingleClick ( ) : System.Boolean
Sprint ( ) : System.Boolean

Helper method to determine if there is an input that should be interpreted as a "sprint" command.

Update ( SharpDX.Toolkit.GameTime gameTime ) : void

Update the state of all desired input devices.

Private Methods

Method Description
OnPointerMoved ( CoreWindow sender, PointerEventArgs args ) : void
OnPointerPressed ( CoreWindow sender, PointerEventArgs args ) : void
OnPointerReleased ( CoreWindow sender, PointerEventArgs args ) : void

Method Details

Acceleration() public method

Get the acceleration data from sensor input as of last update.
public Acceleration ( ) : System.Vector3
return System.Vector3

AccelerometerEnabled() public method

Used to set the enable state of the accelerometer. When the accelerometer is disabled, the acceleration data returned is a zero vector.
public AccelerometerEnabled ( System.Boolean t ) : void
t System.Boolean
return void

InputManager() public method

Initialise the input system. Note that accelerometer input defaults to off.
public InputManager ( Project2Game game ) : System
game Project2Game
return System

IsKeyDown() public method

Check if Key is pressed.
public IsKeyDown ( Keys key ) : System.Boolean
key Keys
return System.Boolean

Jump() public method

Helper method to determine if there is an input that should be interpreted as a "jump" command.
public Jump ( ) : System.Boolean
return System.Boolean

MouseDelta() public method

Get a non-normalised vector representing the direction of mouse movement since the last frame;
public MouseDelta ( ) : System.Vector2
return System.Vector2

MouseDeltaEnabled() public method

Enable capturing of mouse cursor and mouse delta data.
public MouseDeltaEnabled ( System.Boolean t ) : void
t System.Boolean
return void

MousePosition() public method

Get the raw mouse position
public MousePosition ( ) : System.Vector2
return System.Vector2

MouseState() public method

Get the raw mouse state;
public MouseState ( ) : SharpDX.Toolkit.Input.MouseState
return SharpDX.Toolkit.Input.MouseState

PauseRequest() public method

Helper method to determine the player has requested a new pause or unpause event
public PauseRequest ( ) : bool
return bool

PointerState() public method

Get the raw pointer state;
public PointerState ( ) : SharpDX.Toolkit.Input.PointerState
return SharpDX.Toolkit.Input.PointerState

PrimaryDirection() public method

Helper method to return primary directional input vector
public PrimaryDirection ( ) : System.Vector3
return System.Vector3

SecondaryDirection() public method

Helper method to return secondary directional input vector
public SecondaryDirection ( ) : System.Vector3
return System.Vector3

SingleClick() public method

public SingleClick ( ) : System.Boolean
return System.Boolean

Sprint() public method

Helper method to determine if there is an input that should be interpreted as a "sprint" command.
public Sprint ( ) : System.Boolean
return System.Boolean

Update() public method

Update the state of all desired input devices.
public Update ( SharpDX.Toolkit.GameTime gameTime ) : void
gameTime SharpDX.Toolkit.GameTime
return void

Property Details

gestureRecognizer public_oe property

public GestureRecognizer,Windows.UI.Input gestureRecognizer
return Windows.UI.Input.GestureRecognizer

mouseClick public_oe property

public Boolean,System mouseClick
return System.Boolean

window public_oe property

public CoreWindow,Windows.UI.Core window
return Windows.UI.Core.CoreWindow