Class TInputShortcutBindingControllerAxis

Unit

Declaration

type TInputShortcutBindingControllerAxis = class(TInputShortcutBinding)

Description

Trigger TInputShortcut by a game controller axis. For example, trigger action when user moves the left stick of the controller. Right now, this only causes IsPressed (so axis can be detected as pressed) and never reacts tp IsEvent (since axis doesn't report there).

Hierarchy

Overview

Fields

Public nested const DefaultDeadZone = 0.1;

Methods

Public constructor Create(AOwner: TComponent); override;
Public function IsPressed(const Container: TCastleContainer; out HowMuch: Single): Boolean; override;
Public function ToString: String; override;

Properties

Public property Axis: TGameControllerAxis read FAxis write FAxis default gaLeftStick;
Public property Positive: Boolean read FPositive write FPositive default true;
Public property Coord: T2DAxis read FCoord write FCoord default 0;
Public property DeadZone: Single read FDeadZone write FDeadZone default DefaultDeadZone;
Public property ControllerIndex: Integer read FControllerIndex write FControllerIndex default -1;

Description

Fields

Public nested const DefaultDeadZone = 0.1;

This item has no description.

Methods

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Public function IsPressed(const Container: TCastleContainer; out HowMuch: Single): Boolean; override;

This item has no description. Showing description inherited from TInputShortcutBinding.IsPressed.

Is the input currently pressed. If returns True, HowMuch is set to a value between 0.0 and 1.0 that says "how much" the input is pressed (e.g. with what pressure is the game controller axis pressed). If returns False, HowMuch is always 0.0.

Public function ToString: String; override;

function IsEvent(const Event: TInputPressRelease): Boolean; override;

Properties

Public property Axis: TGameControllerAxis read FAxis write FAxis default gaLeftStick;

Which game contoller axis is taken into account.

Public property Positive: Boolean read FPositive write FPositive default true;

Whether the posititive or negative value of the axis causes the pressed state.

Public property Coord: T2DAxis read FCoord write FCoord default 0;

Which axis coordinate is taken into account.

  • 0 means to look at axis X,

  • 1 (only available for 2D axes) means to look at axis Y coordinate.

Public property DeadZone: Single read FDeadZone write FDeadZone default DefaultDeadZone;

Values of the axis smaller (or equal) than this DeadZone are ignored. This makes sense when it's 0.0 (no deadzone, any value <> 0 will trigger) or values < 1.0 (like 0.1, to ignore small movement of the axis).

Public property ControllerIndex: Integer read FControllerIndex write FControllerIndex default -1;

Which game controller is taken into account. Value -1 (default) means to look at all controllers and choose maximum.


Generated by PasDoc 0.16.0-snapshot.