blob: 09071b2ad16086942ebf4ddbe7447494fc624839 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Timer" inherits="Node" category="Core" version="3.0-beta">
<brief_description>
A countdown timer.
</brief_description>
<description>
Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one shot" mode.
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_time_left" qualifiers="const">
<return type="float">
</return>
<description>
Returns the timer's remaining time in seconds. Returns 0 if the timer is inactive.
</description>
</method>
<method name="is_paused" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the timer is paused.
</description>
</method>
<method name="is_stopped" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the timer is stopped.
</description>
</method>
<method name="set_paused">
<return type="void">
</return>
<argument index="0" name="paused" type="bool">
</argument>
<description>
Pauses the timer. If [code]paused[/code] is [code]true[/code], the timer will not process until it is started or unpaused again, even if [method start] is called.
</description>
</method>
<method name="start">
<return type="void">
</return>
<description>
Starts the timer. This also resets the remaining time to [code]wait_time[/code].
Note: this method will not resume a paused timer. See [method set_paused].
</description>
</method>
<method name="stop">
<return type="void">
</return>
<description>
Stop (cancel) the Timer.
</description>
</method>
</methods>
<members>
<member name="autostart" type="bool" setter="set_autostart" getter="has_autostart">
If [code]true[/code], Timer will automatically start when entering the scene tree. Default value: [code]false[/code].
</member>
<member name="one_shot" type="bool" setter="set_one_shot" getter="is_one_shot">
If [code]true[/code], Timer will stop when reaching 0. If [code]false[/code], it will restart. Default value: [code]false[/code].
</member>
<member name="process_mode" type="int" setter="set_timer_process_mode" getter="get_timer_process_mode" enum="Timer.TimerProcessMode">
Processing mode. Uses TIMER_PROCESS_* constants as value.
</member>
<member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time">
Wait time in seconds.
</member>
</members>
<signals>
<signal name="timeout">
<description>
Emitted when the Timer reaches 0.
</description>
</signal>
</signals>
<constants>
<constant name="TIMER_PROCESS_PHYSICS" value="0" enum="TimerProcessMode">
Update the Timer during the physics step at each frame (fixed framerate processing).
</constant>
<constant name="TIMER_PROCESS_IDLE" value="1" enum="TimerProcessMode">
Update the Timer during the idle time at each frame.
</constant>
</constants>
</class>
|