Class TGameControllers

Unit

Declaration

type TGameControllers = class(TObject)

Description

Manage game controllers (joysticks, gamepads). See examples/game_controllers for usage examples.

Hierarchy

  • TObject
  • TGameControllers

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure DoChange;
Public function Count: Integer;
Public procedure Initialize;
Public function InternalExplicitBackend: TInternalControllerManagerBackend;

Properties

Public property Items[const Index: Integer]: TGameController read GetItems;
Public property Initialized: Boolean read FInitialized;
Public property OnChange: TNotifyEvent read FOnChange write FOnChange;

Description

Methods

Public constructor Create;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public procedure DoChange;

Calls OnChange.

Public function Count: Integer;

Number of connected controllers.

Public procedure Initialize;

Detect connected controllers now and keep updating this list when controllers are connected / disconnected. On some platforms, you need to call this to search for connected controllers, otherwise you will always have zero controllers. Calling this again is allowed and harmless.

Public function InternalExplicitBackend: TInternalControllerManagerBackend;

Get (creating if necessary) explicit backend. Always returns TExplicitControllerManagerBackend, but cannot be declared as such. Used by CASTLE_WINDOW_LIBRARY when an external API notifies us about the controllers state.

Properties

Public property Items[const Index: Integer]: TGameController read GetItems;

List of connected controllers. Use this to access individual controllers.

Public property Initialized: Boolean read FInitialized;

Was Initialize called.

Public property OnChange: TNotifyEvent read FOnChange write FOnChange;

Called after TGameController instances on the list changed (some have been added, some destroyed).

This can be called at any moment, as controllers may be connected / disconnected at any moment.


Generated by PasDoc 0.16.0-snapshot.