InputActionButton
Inherits: InputAction < InputConfig < Resource
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Description
This class is specific configuration that maps a button input to an action. This is a 0-dimensional/boolean input: either the button is pressed or not.
Properties
|
Methods
void |
|
|
equals(other_action: InputAction) |
|
contains_input_event(input_event: |
|
|
new_from_dict(dict: |
Property Descriptions
InputEvent input 🔗
Godot InputEvent that will trigger this action.
Method Descriptions
void apply_config() 🔗
If you want to use an InputAction, this is the method to call. This method tells the InputAction to call Godot’s Input API to configure itself there. For concrete actions, this means creating an action on the InputMap and assigning the input to it, for schemes or group of actions this means applying each InputAction individually.
bool equals(other_action: InputAction) 🔗
Checks if the passed InputAction has the same value as the current instance. Returns true if so, false otherwise.
bool contains_input_event(input_event: InputEvent) 🔗
Checks if the InputAction uses the parameter InputEvent in any way. This method is used to know if there are conflicting inputs (inputs used for multiple actions) in the current scheme. This then is used to warn the player about this conflict.
Dictionary get_as_dict() 🔗
Method used for serialization. When saving a control scheme to a file, it is first turned into a Dictionary with the data it needs (category, name, configuration…) so it can be stored as a JSON file. The configuration might include the InputEvent object that triggers the action.
InputAction new_from_dict(dict: Dictionary) static 🔗
Method used for deserialization. When loading a control scheme from a file, new instances of InputAction classes are created with the configuration from the stored JSON file. This method uses the data in those JSON objects to create a new instance of the InputAction.