Table of Contents

Class InputActionDefinition

Namespace
BSGameLib.Game.Input
Assembly
BSGameLib.Game.dll

The definition of an input action: its id, display name, type and default binding. Create one with Button(string, string, InputBinding, string) or Axis1D(string, string, InputBinding, string).

public sealed class InputActionDefinition
Inheritance
InputActionDefinition
Inherited Members

Properties

ActionType

Whether the action is a button or an axis.

public InputActionType ActionType { get; }

Property Value

InputActionType

Category

The group the action is listed under, such as Movement. Null when it has none.

public string Category { get; }

Property Value

string

DefaultBinding

The binding the action has before the player changes it.

public InputBinding DefaultBinding { get; }

Property Value

InputBinding

DisplayName

The name shown for the action, such as on a controls screen.

public string DisplayName { get; }

Property Value

string

Id

The action's id. Game code refers to the action by this id.

public string Id { get; }

Property Value

string

Methods

Axis1D(string, string, InputBinding, string)

Creates an axis action. Throws when the binding has button inputs.

public static InputActionDefinition Axis1D(string id, string displayName, InputBinding binding, string category = null)

Parameters

id string
displayName string
binding InputBinding
category string

Returns

InputActionDefinition

Exceptions

ArgumentException

The binding has keyboard keys or gamepad buttons.

Button(string, string, InputBinding, string)

Creates a button action. Throws when the binding has axis inputs.

public static InputActionDefinition Button(string id, string displayName, InputBinding binding, string category = null)

Parameters

id string
displayName string
binding InputBinding
category string

Returns

InputActionDefinition

Exceptions

ArgumentException

The binding has keyboard or gamepad axes.