SceneTreeTimer.xml 999 B

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SceneTreeTimer" inherits="Reference" category="Core" version="3.1.2">
  3. <brief_description>
  4. One-shot timer.
  5. </brief_description>
  6. <description>
  7. A one-shot timer managed by the scene tree, which emits [signal timeout] on completion. See also [method SceneTree.create_timer].
  8. As opposed to [Timer], it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example:
  9. [codeblock]
  10. func some_function():
  11. print("start")
  12. yield(get_tree().create_timer(1.0), "timeout")
  13. print("end")
  14. [/codeblock]
  15. </description>
  16. <tutorials>
  17. </tutorials>
  18. <methods>
  19. </methods>
  20. <members>
  21. <member name="time_left" type="float" setter="set_time_left" getter="get_time_left">
  22. The time remaining.
  23. </member>
  24. </members>
  25. <signals>
  26. <signal name="timeout">
  27. <description>
  28. Emitted when the timer reaches 0.
  29. </description>
  30. </signal>
  31. </signals>
  32. <constants>
  33. </constants>
  34. </class>