Skip to content

InputIconManager

Inherits: Resource

InputIconManager is responsible for managing what input glyphs to show in the UI

Description

The InputIconManager will keep track of the last used input device and signal when the input device has changed to allow the UI to display the appropriate glyphs. In order for InputIconManager to work correctly, a InputIconProcessor must be added to the scene.

Properties

Type Name Default
State in_game_state
InputPlumberInstance input_plumber
CustomLogger logger
bool disabled false
int last_input_type 1
String last_input_device

Methods

Returns Signature
Dictionary discover_mappings(mappings_dir: String)
Dictionary discover_device_mappings(mappings_dir: String)
void refresh()
Texture[] parse_path(path: String, mapping_name: String = "", input_type: int = last_input_type)
InputIconMapping load_matching_mapping(device_name: String)
String get_mapping_name_from_device(device_name: String)
void set_last_input_type(_last_input_type: int)

Property Descriptions

in_game_state

State in_game_state

Note

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

input_plumber

InputPlumberInstance input_plumber

Note

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

logger

CustomLogger logger

Note

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

disabled

bool disabled = false

Disable/Enable signaling on input type changes

last_input_type

int last_input_type = 1

The last detected input type

last_input_device

String last_input_device

The device name of the last detected input


Method Descriptions

discover_mappings()

Dictionary discover_mappings(mappings_dir: String)

Discover all input icon mappings from the specified path

discover_device_mappings()

Dictionary discover_device_mappings(mappings_dir: String)

Discover all input icon mapping devices from the specified path

refresh()

void refresh()

Refresh all icons

parse_path()

Texture[] parse_path(path: String, mapping_name: String = "", input_type: int = last_input_type)

Parse the given input path and return the texture(s) associated with that type of input. The input path can either be in the form of "joypad/south" for specific inputs, or the name of an event action defined in the project's input map (i.e. "ui_accept"). Optionally, a mapping name can be passed to get a specific icon from a specific mapping.

load_matching_mapping()

InputIconMapping load_matching_mapping(device_name: String)

Load and return the mapping that matches the given device.

get_mapping_name_from_device()

String get_mapping_name_from_device(device_name: String)

Returns the mapping name for the given device name. The mapping name is the "name" property of an InputIconMapping.

set_last_input_type()

void set_last_input_type(_last_input_type: int)

Set the last input type to the given value and emit a signal