RPG_2D_CONTROLLERS

Inherits: Node < Object

This Singleton automatically creates a list off all connected controllers and automatically changes the light color of any newly connected controllers

Properties

Array[Dictionary]

Controllers

[...]

Methods

void

_ready()

void

_joy_changed(device: int, connected: bool)

void

change_light(device: int, color: Color)

Color

_player_color(player_num: int)


Property Descriptions

Array[Dictionary] Controllers = [...] πŸ”—

List of connected controllers.

Note: Controller[0] is the default device (eg. KeyBoard/Mouse) and all others are gamepads.

The dicionary contains:

  • id: Device number (-1 means default device)

  • name: Device name as a string

  • has_light: Boolean for whether or not the controller has a light

  • light: The color of the light (0 means there is no light, otherwise the value is of type Color


Method Descriptions

void _ready() πŸ”—

There is currently no description for this method. Please help us by contributing one!


void _joy_changed(device: int, connected: bool) πŸ”—

There is currently no description for this method. Please help us by contributing one!


void change_light(device: int, color: Color) πŸ”—

Change a controller’s light through here so that the Controllers array stays updated.


Color _player_color(player_num: int) πŸ”—

There is currently no description for this method. Please help us by contributing one!