Class AxisConfig
Maps keyboard, controller, or mouse inputs to a "friendly name" that will later be bound to continuous game behavior, such as movement. The inputs mapped in AxisMappings are continuously polled, even if they are just reporting that their input value.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class AxisConfig : ValueType
Fields
Axis
The axis type (mouse, gamepad, etc.).
Declaration
[EditorOrder(10)]
public InputAxisType Axis
Field Value
InputAxisType
|
DeadZone
Any positive or negative values that are less than this number will register as zero. Useful for gamepads to specify the deadzone.
Declaration
[EditorOrder(50)]
public float DeadZone
Field Value
System.Single
|
Gamepad
Which gamepad should be used.
Declaration
[EditorOrder(20)]
public InputGamepadIndex Gamepad
Field Value
InputGamepadIndex
|
GamepadNegativeButton
The button to be pressed for movement in negative direction. Use None to ignore it.
Declaration
[EditorOrder(46)]
public GamepadButton GamepadNegativeButton
Field Value
GamepadButton
|
GamepadPositiveButton
The button to be pressed for movement in positive direction. Use None to ignore it.
Declaration
[EditorOrder(45)]
public GamepadButton GamepadPositiveButton
Field Value
GamepadButton
|
Gravity
For keyboard input describes how fast will the input recenter. Speed (in units/s) that output value will rest to neutral value if not when device at rest.
Declaration
[EditorOrder(70)]
public float Gravity
Field Value
System.Single
|
Name
The axis "friendly name" used to access it from code.
Declaration
[EditorOrder(0)]
public string Name
Field Value
System.String
|
NegativeButton
The button to be pressed for movement in negative direction. Use None to ignore it.
Declaration
[EditorOrder(40)]
public KeyboardKeys NegativeButton
Field Value
KeyboardKeys
|
PositiveButton
The button to be pressed for movement in positive direction. Use None to ignore it.
Declaration
[EditorOrder(30)]
public KeyboardKeys PositiveButton
Field Value
KeyboardKeys
|
Scale
Additional scale parameter applied to the axis value. Allows to invert it or modify the range.
Declaration
[EditorOrder(80)]
public float Scale
Field Value
System.Single
|
Sensitivity
For keyboard input, a larger value will result in faster response time (in units/s). A lower value will be more smooth. For Mouse delta the value will scale the actual mouse delta.
Declaration
[EditorOrder(60)]
public float Sensitivity
Field Value
System.Single
|
Snap
If enabled, the axis value will be immediately reset to zero after it receives opposite inputs. For keyboard input only.
Declaration
[EditorOrder(90)]
public bool Snap
Field Value
System.Boolean
|
Properties
Default
The default AxisConfig.
Declaration
public static AxisConfig Default { get; }
Property Value
AxisConfig
|