SceneTreeTimer.xml 1016 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SceneTreeTimer" inherits="Reference" category="Core" version="3.1">
  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. <demos>
  19. </demos>
  20. <methods>
  21. </methods>
  22. <members>
  23. <member name="time_left" type="float" setter="set_time_left" getter="get_time_left">
  24. The time remaining.
  25. </member>
  26. </members>
  27. <signals>
  28. <signal name="timeout">
  29. <description>
  30. Emitted when the timer reaches 0.
  31. </description>
  32. </signal>
  33. </signals>
  34. <constants>
  35. </constants>
  36. </class>