浏览代码

Updated set_as_action code

Fixed code example using set_as_action.
Issue fixed:
https://github.com/godotengine/godot-docs/issues/2435
Hearto 6 年之前
父节点
当前提交
faa17097c3
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      tutorials/inputs/inputevent.rst

+ 2 - 1
tutorials/inputs/inputevent.rst

@@ -185,7 +185,8 @@ The Input singleton has a method for this:
 
     var ev = InputEventAction.new()
     # set as move_left, pressed
-    ev.set_as_action("move_left", true)
+    ev.action = "move_left"
+    ev.pressed = true
     # feedback
     Input.parse_input_event(ev)