class_timer.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Timer.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Timer:
  5. Timer
  6. =====
  7. **Inherits:** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. A countdown timer.
  12. Member Functions
  13. ----------------
  14. +--------------------------+-------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`is_stopped<class_Timer_is_stopped>` **(** **)** const |
  16. +--------------------------+-------------------------------------------------------------+
  17. | void | :ref:`start<class_Timer_start>` **(** **)** |
  18. +--------------------------+-------------------------------------------------------------+
  19. | void | :ref:`stop<class_Timer_stop>` **(** **)** |
  20. +--------------------------+-------------------------------------------------------------+
  21. Signals
  22. -------
  23. .. _class_Timer_timeout:
  24. - **timeout** **(** **)**
  25. Emitted when the Timer reaches 0.
  26. Member Variables
  27. ----------------
  28. .. _class_Timer_autostart:
  29. - :ref:`bool<class_bool>` **autostart** - If ``true``, Timer will automatically start when entering the scene tree. Default value: ``false``.
  30. .. _class_Timer_one_shot:
  31. - :ref:`bool<class_bool>` **one_shot** - If ``true``, Timer will stop when reaching 0. If ``false``, it will restart. Default value: ``false``.
  32. .. _class_Timer_paused:
  33. - :ref:`bool<class_bool>` **paused** - If ``true``, the timer is paused and will not process until it is unpaused again, even if :ref:`start<class_Timer_start>` is called.
  34. .. _class_Timer_process_mode:
  35. - :ref:`TimerProcessMode<enum_timer_timerprocessmode>` **process_mode** - Processing mode. Uses TIMER_PROCESS\_\* constants as value.
  36. .. _class_Timer_time_left:
  37. - :ref:`float<class_float>` **time_left** - The timer's remaining time in seconds. Returns 0 if the timer is inactive.
  38. .. _class_Timer_wait_time:
  39. - :ref:`float<class_float>` **wait_time** - Wait time in seconds.
  40. Enums
  41. -----
  42. .. _enum_Timer_TimerProcessMode:
  43. enum **TimerProcessMode**
  44. - **TIMER_PROCESS_PHYSICS** = **0** --- Update the Timer during the physics step at each frame (fixed framerate processing).
  45. - **TIMER_PROCESS_IDLE** = **1** --- Update the Timer during the idle time at each frame.
  46. Description
  47. -----------
  48. Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one shot" mode.
  49. Member Function Description
  50. ---------------------------
  51. .. _class_Timer_is_stopped:
  52. - :ref:`bool<class_bool>` **is_stopped** **(** **)** const
  53. Returns ``true`` if the timer is stopped.
  54. .. _class_Timer_start:
  55. - void **start** **(** **)**
  56. Starts the timer. This also resets the remaining time to ``wait_time``.
  57. Note: this method will not resume a paused timer. See :ref:`set_paused<class_Timer_set_paused>`.
  58. .. _class_Timer_stop:
  59. - void **stop** **(** **)**
  60. Stop (cancel) the Timer.