Browse Source

InputEvent tutorial: Recommend Input instead of MainLoop for parsing events.

(cherry picked from commit 0ca7e06f36934dd2fb97f468f7072fe93cb7348b)
Andreas Haas 8 years ago
parent
commit
3904b8feac
1 changed files with 3 additions and 3 deletions
  1. 3 3
      learning/features/inputs/inputevent.rst

+ 3 - 3
learning/features/inputs/inputevent.rst

@@ -135,8 +135,8 @@ Any event has the methods :ref:`InputEvent.is_action() <class_InputEvent_is_acti
 
 
 Alternatively, it may be desired to supply the game back with an action
 Alternatively, it may be desired to supply the game back with an action
 from the game code (a good example of this is detecting gestures).
 from the game code (a good example of this is detecting gestures).
-SceneTree (derived from MainLoop) has a method for this:
-:ref:`MainLoop.input_event() <class_MainLoop_input_event>`. You would normally use it like this:
+The Input singleton has a method for this:
+:ref:`Input.parse_input_event() <class_input_parse_input_event>`. You would normally use it like this:
 
 
 ::
 ::
 
 
@@ -145,7 +145,7 @@ SceneTree (derived from MainLoop) has a method for this:
     # set as move_left, pressed
     # set as move_left, pressed
     ev.set_as_action("move_left", true) 
     ev.set_as_action("move_left", true) 
     # feedback
     # feedback
-    get_tree().input_event(ev)
+    Input.parse_input_event(ev)
 
 
 InputMap
 InputMap
 --------
 --------