mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
To tell potential contributors that they should NOT edit those files but instead should work on the class.xml source of the main Godot repo
131 lines
5.6 KiB
ReStructuredText
131 lines
5.6 KiB
ReStructuredText
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
|
|
|
|
.. _class_Timer:
|
|
|
|
Timer
|
|
=====
|
|
|
|
**Inherits:** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_wait_time<class_Timer_set_wait_time>` **(** :ref:`float<class_float>` time_sec **)** |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_wait_time<class_Timer_get_wait_time>` **(** **)** const |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_one_shot<class_Timer_set_one_shot>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_one_shot<class_Timer_is_one_shot>` **(** **)** const |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_autostart<class_Timer_set_autostart>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_autostart<class_Timer_has_autostart>` **(** **)** const |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`start<class_Timer_start>` **(** **)** |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`stop<class_Timer_stop>` **(** **)** |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_time_left<class_Timer_get_time_left>` **(** **)** const |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_timer_process_mode<class_Timer_set_timer_process_mode>` **(** :ref:`int<class_int>` mode **)** |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_timer_process_mode<class_Timer_get_timer_process_mode>` **(** **)** const |
|
|
+----------------------------+------------------------------------------------------------------------------------------------------------+
|
|
|
|
Signals
|
|
-------
|
|
|
|
- **timeout** **(** **)**
|
|
|
|
Numeric Constants
|
|
-----------------
|
|
|
|
- **TIMER_PROCESS_FIXED** = **0** --- Update the timer at fixed intervals (framerate processing).
|
|
- **TIMER_PROCESS_IDLE** = **1** --- Update the timer during the idle time at each frame.
|
|
|
|
Description
|
|
-----------
|
|
|
|
Timer node. This is a simple node that will emit a timeout callback when the timer runs out. It can optionally be set to loop.
|
|
|
|
Member Function Description
|
|
---------------------------
|
|
|
|
.. _class_Timer_set_wait_time:
|
|
|
|
- void **set_wait_time** **(** :ref:`float<class_float>` time_sec **)**
|
|
|
|
Set wait time in seconds. When the time is over, it will emit the timeout signal.
|
|
|
|
.. _class_Timer_get_wait_time:
|
|
|
|
- :ref:`float<class_float>` **get_wait_time** **(** **)** const
|
|
|
|
Return the wait time in seconds.
|
|
|
|
.. _class_Timer_set_one_shot:
|
|
|
|
- void **set_one_shot** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
Set as one-shot. If enabled, the timer will stop after timeout, otherwise it will automatically restart.
|
|
|
|
.. _class_Timer_is_one_shot:
|
|
|
|
- :ref:`bool<class_bool>` **is_one_shot** **(** **)** const
|
|
|
|
Return true if configured as one-shot.
|
|
|
|
.. _class_Timer_set_autostart:
|
|
|
|
- void **set_autostart** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
Set to automatically start when entering the scene.
|
|
|
|
.. _class_Timer_has_autostart:
|
|
|
|
- :ref:`bool<class_bool>` **has_autostart** **(** **)** const
|
|
|
|
Return true if set to automatically start when entering the scene.
|
|
|
|
.. _class_Timer_start:
|
|
|
|
- void **start** **(** **)**
|
|
|
|
Start the timer.
|
|
|
|
.. _class_Timer_stop:
|
|
|
|
- void **stop** **(** **)**
|
|
|
|
Stop (cancel) the timer.
|
|
|
|
.. _class_Timer_get_time_left:
|
|
|
|
- :ref:`float<class_float>` **get_time_left** **(** **)** const
|
|
|
|
Return the time left for timeout in seconds if the timer is active, 0 otherwise.
|
|
|
|
.. _class_Timer_set_timer_process_mode:
|
|
|
|
- void **set_timer_process_mode** **(** :ref:`int<class_int>` mode **)**
|
|
|
|
Set the timer's processing mode (fixed or idle, use TIMER_PROCESS\_\* constants as argument).
|
|
|
|
.. _class_Timer_get_timer_process_mode:
|
|
|
|
- :ref:`int<class_int>` **get_timer_process_mode** **(** **)** const
|
|
|
|
Return the timer's processing mode.
|
|
|
|
|