C# Класс Project2.InputManager

This class handles all user input for the game, implemented as a system.
Наследование: SharpDX.Toolkit.GameSystem
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
gestureRecognizer Windows.UI.Input.GestureRecognizer
mouseClick System.Boolean
window Windows.UI.Core.CoreWindow

Private Properties

Свойство Тип Описание
OnPointerMoved void
OnPointerPressed void
OnPointerReleased void

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

Метод Описание
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.

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

Метод Описание
OnPointerMoved ( CoreWindow sender, PointerEventArgs args ) : void
OnPointerPressed ( CoreWindow sender, PointerEventArgs args ) : void
OnPointerReleased ( CoreWindow sender, PointerEventArgs args ) : void

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

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

Get the acceleration data from sensor input as of last update.
public Acceleration ( ) : System.Vector3
Результат System.Vector3

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

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
Результат void

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

Initialise the input system. Note that accelerometer input defaults to off.
public InputManager ( Project2Game game ) : System
game Project2Game
Результат System

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

Check if Key is pressed.
public IsKeyDown ( Keys key ) : System.Boolean
key Keys
Результат System.Boolean

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

Helper method to determine if there is an input that should be interpreted as a "jump" command.
public Jump ( ) : System.Boolean
Результат System.Boolean

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

Get a non-normalised vector representing the direction of mouse movement since the last frame;
public MouseDelta ( ) : System.Vector2
Результат System.Vector2

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

Enable capturing of mouse cursor and mouse delta data.
public MouseDeltaEnabled ( System.Boolean t ) : void
t System.Boolean
Результат void

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

Get the raw mouse position
public MousePosition ( ) : System.Vector2
Результат System.Vector2

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

Get the raw mouse state;
public MouseState ( ) : SharpDX.Toolkit.Input.MouseState
Результат SharpDX.Toolkit.Input.MouseState

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

Helper method to determine the player has requested a new pause or unpause event
public PauseRequest ( ) : bool
Результат bool

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

Get the raw pointer state;
public PointerState ( ) : SharpDX.Toolkit.Input.PointerState
Результат SharpDX.Toolkit.Input.PointerState

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

Helper method to return primary directional input vector
public PrimaryDirection ( ) : System.Vector3
Результат System.Vector3

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

Helper method to return secondary directional input vector
public SecondaryDirection ( ) : System.Vector3
Результат System.Vector3

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

public SingleClick ( ) : System.Boolean
Результат System.Boolean

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

Helper method to determine if there is an input that should be interpreted as a "sprint" command.
public Sprint ( ) : System.Boolean
Результат System.Boolean

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

Update the state of all desired input devices.
public Update ( SharpDX.Toolkit.GameTime gameTime ) : void
gameTime SharpDX.Toolkit.GameTime
Результат void

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

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

public GestureRecognizer,Windows.UI.Input gestureRecognizer
Результат Windows.UI.Input.GestureRecognizer

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

public Boolean,System mouseClick
Результат System.Boolean

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

public CoreWindow,Windows.UI.Core window
Результат Windows.UI.Core.CoreWindow