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).

Source: ui/castleinputs.pas (line 132).

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.

Source: ui/castleinputs.pas (line 141).

Methods

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Source: ui/castleinputs.pas (line 167).

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.

Source: ui/castleinputs.pas (line 169).

Public function ToString: String; override;

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

Source: ui/castleinputs.pas (line 173).

Properties

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

Which game contoller axis is taken into account.

Source: ui/castleinputs.pas (line 144).

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

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

Source: ui/castleinputs.pas (line 147).

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.

Source: ui/castleinputs.pas (line 155).

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).

Source: ui/castleinputs.pas (line 160).

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.

Source: ui/castleinputs.pas (line 165).


Generated by PasDoc 0.17.0.snapshot.