class_scenetreetimer.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the SceneTreeTimer.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_SceneTreeTimer:
  5. SceneTreeTimer
  6. ==============
  7. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. One-shot timer.
  12. Properties
  13. ----------
  14. +---------------------------+-----------------------------------------------------------+
  15. | :ref:`float<class_float>` | :ref:`time_left<class_SceneTreeTimer_property_time_left>` |
  16. +---------------------------+-----------------------------------------------------------+
  17. Signals
  18. -------
  19. .. _class_SceneTreeTimer_signal_timeout:
  20. - **timeout** **(** **)**
  21. Emitted when the timer reaches 0.
  22. Description
  23. -----------
  24. A one-shot timer managed by the scene tree, which emits :ref:`timeout<class_SceneTreeTimer_signal_timeout>` on completion. See also :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>`.
  25. As opposed to :ref:`Timer<class_Timer>`, it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example:
  26. ::
  27. func some_function():
  28. print("start")
  29. yield(get_tree().create_timer(1.0), "timeout")
  30. print("end")
  31. Property Descriptions
  32. ---------------------
  33. .. _class_SceneTreeTimer_property_time_left:
  34. - :ref:`float<class_float>` **time_left**
  35. +----------+----------------------+
  36. | *Setter* | set_time_left(value) |
  37. +----------+----------------------+
  38. | *Getter* | get_time_left() |
  39. +----------+----------------------+
  40. The time remaining.