diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-18 11:04:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-18 11:04:59 +0200 |
commit | 80c2f303ae94210c89873e239a6a5e7ba29c1627 (patch) | |
tree | 7b90df0819a85d60e3639a5a2b316b01f4978471 | |
parent | d154e55f45e68efb17a65adea5b86416d37998f0 (diff) | |
parent | b950867df82e1c6aa19063353c9190471b8c80ce (diff) |
Merge pull request #31445 from KoBeWi/how_to_input
Clarify usage of action_press
-rw-r--r-- | doc/classes/Input.xml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 91ebcd52f6..33b9da6fdf 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -20,6 +20,7 @@ <description> This will simulate pressing the specified action. The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action. + [b]Note:[/b] This method will not cause any [method Node._input] calls. It is intended to be used with [method is_action_pressed] and [method is_action_just_pressed]. If you want to simulate [code]_input[/code], use [method parse_input_event] instead. </description> </method> <method name="action_release"> @@ -283,7 +284,14 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> - Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. + Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. Also generates [method Node._input] calls. + Example: + [codeblock] + var a = InputEventAction.new() + a.action = "ui_cancel" + a.pressed = true + Input.parse_input_event(a) + [/codeblock] </description> </method> <method name="remove_joy_mapping"> |