C# Class Project2.InputManager

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

Méthodes publiques

Свойство Type Description
gestureRecognizer Windows.UI.Input.GestureRecognizer
mouseClick System.Boolean
window Windows.UI.Core.CoreWindow

Private Properties

Свойство Type Description
OnPointerMoved void
OnPointerPressed void
OnPointerReleased void

Méthodes publiques

Méthode 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

Méthode Description
OnPointerMoved ( CoreWindow sender, PointerEventArgs args ) : void
OnPointerPressed ( CoreWindow sender, PointerEventArgs args ) : void
OnPointerReleased ( CoreWindow sender, PointerEventArgs args ) : void

Method Details

Acceleration() public méthode

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

AccelerometerEnabled() public méthode

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
Résultat void

InputManager() public méthode

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

IsKeyDown() public méthode

Check if Key is pressed.
public IsKeyDown ( Keys key ) : System.Boolean
key Keys
Résultat System.Boolean

Jump() public méthode

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

MouseDelta() public méthode

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

MouseDeltaEnabled() public méthode

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

MousePosition() public méthode

Get the raw mouse position
public MousePosition ( ) : System.Vector2
Résultat System.Vector2

MouseState() public méthode

Get the raw mouse state;
public MouseState ( ) : SharpDX.Toolkit.Input.MouseState
Résultat SharpDX.Toolkit.Input.MouseState

PauseRequest() public méthode

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

PointerState() public méthode

Get the raw pointer state;
public PointerState ( ) : SharpDX.Toolkit.Input.PointerState
Résultat SharpDX.Toolkit.Input.PointerState

PrimaryDirection() public méthode

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

SecondaryDirection() public méthode

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

SingleClick() public méthode

public SingleClick ( ) : System.Boolean
Résultat System.Boolean

Sprint() public méthode

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

Update() public méthode

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

Property Details

gestureRecognizer public_oe property

public GestureRecognizer,Windows.UI.Input gestureRecognizer
Résultat Windows.UI.Input.GestureRecognizer

mouseClick public_oe property

public Boolean,System mouseClick
Résultat System.Boolean

window public_oe property

public CoreWindow,Windows.UI.Core window
Résultat Windows.UI.Core.CoreWindow