From 22421e134b3b8a2e1b7fa0364cb0c3c71319caad Mon Sep 17 00:00:00 2001 From: Micky Date: Sat, 20 Jan 2024 18:49:05 +0100 Subject: [PATCH] Tweak Timer documentation --- doc/classes/Timer.xml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml index 03a651ad9aeb..00e5c6e144eb 100644 --- a/doc/classes/Timer.xml +++ b/doc/classes/Timer.xml @@ -15,15 +15,15 @@ - Returns [code]true[/code] if the timer is stopped. + Returns [code]true[/code] if the timer is stopped or has not started. - Starts the timer. Sets [member wait_time] to [param time_sec] if [code]time_sec > 0[/code]. This also resets the remaining time to [member wait_time]. - [b]Note:[/b] This method will not resume a paused timer. See [member paused]. + Starts the timer, if it was not started already. Fails if the timer is not inside the tree. If [param time_sec] is greater than [code]0[/code], this value is used for the [member wait_time]. + [b]Note:[/b] This method does not resume a paused timer. See [member paused]. @@ -35,40 +35,40 @@ - If [code]true[/code], the timer will automatically start when entering the scene tree. - [b]Note:[/b] This property is automatically set to [code]false[/code] after the timer enters the scene tree and starts. + If [code]true[/code], the timer will start immediately when it enters the scene tree. + [b]Note:[/b] After the timer enters the tree, this property is automatically set to [code]false[/code]. - If [code]true[/code], the timer will stop when reaching 0. If [code]false[/code], it will restart. + If [code]true[/code], the timer will stop after reaching the end. Otherwise, as by default, the timer will automatically restart. - If [code]true[/code], the timer is paused and will not process until it is unpaused again, even if [method start] is called. + If [code]true[/code], the timer is paused. A paused timer does not process until this property is set back to [code]false[/code], even when [method start] is called. - Processing callback. See [enum TimerProcessCallback]. + Specifies when the timer is updated during the main loop (see [enum TimerProcessCallback]). - The timer's remaining time in seconds. Returns 0 if the timer is inactive. - [b]Note:[/b] This value is read-only and cannot be set. It is based on [member wait_time], which can be set using [method start]. + The timer's remaining time in seconds. This is always [code]0[/code] if the timer is stopped. + [b]Note:[/b] This property is read-only and cannot be modified. It is based on [member wait_time]. - The wait time in seconds. - [b]Note:[/b] Timers can only emit once per rendered frame at most (or once per physics frame if [member process_callback] is [constant TIMER_PROCESS_PHYSICS]). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node. Timers are affected by [member Engine.time_scale], a higher scale means quicker timeouts, and vice versa. + The time required for the timer to end, in seconds. This property can also be set every time [method start] is called. + [b]Note:[/b] Timers can only process once per physics or process frame (depending on the [member process_callback]). An unstable framerate may cause the timer to end inconsistently, which is especially noticeable if the wait time is lower than roughly [code]0.05[/code] seconds. For very short timers, it is recommended to write your own code instead of using a [Timer] node. Timers are also affected by [member Engine.time_scale]. - Emitted when the timer reaches 0. + Emitted when the timer reaches the end. - Update the timer during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). + Update the timer every physics process frame (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). - Update the timer during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). + Update the timer every process (rendered) frame (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]).