Table of Contents

Class LunyInputServiceBase

Namespace
Luny.Engine.Services
/
Assembly
Luny.dll
public abstract class LunyInputServiceBase : LunyEngineServiceBase, ILunyInputService, ILunyEngineService
Expand Details ...
Inheritance
Object
LunyInputServiceBase
Implements
Derived
Inherited Members

Constructors

LunyInputServiceBase()

protected LunyInputServiceBase()

Properties

LastInputEvent

protected LunyInputActionEvent LastInputEvent { get; }

Property Value

LunyInputActionEvent

Methods

AssignUserToLastDevice(String, Int32, ILunyObject)

public abstract void AssignUserToLastDevice(String userName, Int32 deviceId, ILunyObject lunyObject)

Parameters

Type Name Description
String
userName
Int32
deviceId
ILunyObject
lunyObject

EnableInputAction(String, Boolean)

public abstract void EnableInputAction(String actionName, Boolean enable)

Parameters

Type Name Description
String
actionName
Boolean
enable

GetAxis(String)

Gets the analog trigger value (0.0–1.0) for the named button action.

public Single GetAxis(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Single

GetButtonJustPressed(String)

True only on the frame the button transitioned to pressed.

public Boolean GetButtonJustPressed(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Boolean

GetButtonPressed(String)

True while button is held.

public Boolean GetButtonPressed(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Boolean

GetButtonStrength(String)

Returns a button's pressed strength. Used by triggers configured to act like buttons.

public Single GetButtonStrength(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Single

GetDirection(String)

Gets last known axis vector for the named action.

public LunyVector2 GetDirection(String actionName)

Parameters

Type Name Description
String
actionName

Returns

LunyVector2

GetOrCreateInputActionEvent(String)

protected LunyInputActionEvent GetOrCreateInputActionEvent(String actionName)

Parameters

Type Name Description
String
actionName

Returns

LunyInputActionEvent

GetRotation(String)

Gets last known axis vector as rotation (quaternion). Assumes positive Y is up vector.

public LunyQuaternion GetRotation(String actionName)

Parameters

Type Name Description
String
actionName

Returns

LunyQuaternion

GetRotation(String, LunyVector3)

Gets last known axis vector as rotation (quaternion) with custom up vector.

public LunyQuaternion GetRotation(String actionName, LunyVector3 worldUp)

Parameters

Type Name Description
String
actionName
LunyVector3
worldUp

Returns

LunyQuaternion

HandleInputActionEvent(LunyInputActionEvent)

protected void HandleInputActionEvent(LunyInputActionEvent inputEvent)

Parameters

Type Name Description
LunyInputActionEvent
inputEvent

IsUserPairedWithDevice(String, Int32)

public abstract Boolean IsUserPairedWithDevice(String userName, Int32 deviceId)

Parameters

Type Name Description
String
userName
Int32
deviceId

Returns

Boolean

OnServiceFrameBegins()

protected override void OnServiceFrameBegins()

OnServiceFrameEnds()

Clears per-frame transition flags. Called at the start of each frame via OnServicePreUpdate.

protected override void OnServiceFrameEnds()

SetAxisInput(String, Single)

protected void SetAxisInput(String actionName, Single value)

Parameters

Type Name Description
String
actionName
Single
value

SetButtonInput(String, Boolean, Single)

protected void SetButtonInput(String actionName, Boolean pressed, Single strength = 1)

Parameters

Type Name Description
String
actionName
Boolean
pressed
Single
strength

SetControlSchemes(params String[])

Activate a given control scheme eg Gamepad or Keyboard&Mouse to prevent other device input from coming through.

public abstract void SetControlSchemes(params String[] schemeNames)

Parameters

Type Name Description
String[]
schemeNames

SetDirectionalInput(String, LunyVector2)

protected void SetDirectionalInput(String actionName, LunyVector2 value)

Parameters

Type Name Description
String
actionName
LunyVector2
value

UnassignUser(String)

public abstract void UnassignUser(String userName)

Parameters

Type Name Description
String
userName

Events

OnInputAction

Fired when any enabled action changes value.

public event Action<LunyInputActionEvent> OnInputAction

Event Type

Action<LunyInputActionEvent>