Node: Timer

From Waltz
Revision as of 20:45, 28 July 2019 by Patrick Angle (talk | contribs) (Functions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Timer node allows you to create a timer that counts to some amount of time before performing an action. A Timer node can then wait to be asked to restart the timer, or automatically restart the timer. Several properties are available to monitor the progress of the timer, and a timer can be stopped, paused, restarted, or prematurely marked as complete at any time.

Settings

Expected Type Details Default
duration Time The duration of the timer's execution from start to completion. Time(10000)
restartOnCompletion Boolean Restarts the timer automatically upon completion. If true, the timer is restarted on the frame following completion and the running of the completionHandler. If false, the timer remains completed until it is restarted or stopped, but will not be running. true
completionHandler Void The script to run when the timer completes an interval. print("Ding!")

Parameters

Type Details
progress Number A number, between 0.0 and 1.0, representing the current progress of the timer. The progress can also be set, and the timer will adjust accordingly.
running Boolean true if the timer is currently counting, otherwise false. You can pause the timer by setting this value to false, or by using the pause() function.
complete Boolean true if the timer has completed an interval, otherwise false. If restartOnCompletion is true, this value is true for a single frame. If restartOnCompletion is false, then this value remains true until the timer is restarted or the value is manually set to false.

Functions

Arguments Returns Details
start() Void Starts the timer from its current position. If the timer is paused mid-interval, then progress is resumed from the current time. If the timer is currently complete, then the timer is started from the beginning of the interval.
stop() Void Stop the timer and reset its progress back to the beginning of the interval.
pause() Void Pause the timer, leaving its progress intact and ready to be resumed at any time.
restart() Void Start the timer from the beginning, regardless of current progress.
complete() Void Force the timer to complete immediately, regardless of current progress. This will run the completionHandler.

Example Usage

No examples provided.

Nodes
Devices ArtNet Input · ArtNet Output · Interactive LED Processor · NDI™ Input · NDI™ Output · OSC Input · OSC Output · Projector · SensorLink · TCP · TUIO Output · UDP Input · UDP Output · Watchout Media Server
Objects LED Tile Layout · List · Map · Random Number · Simulated Touch · Timer · Value · Wave
Operators Blend · Change · Clip · Cluster Tracker · DMX Multiverse Merge · Ease · Filter · Hold · JSON Mapper · JSON Stringify · Logic · Math · Proximity · Range · Rotate · Scale · Shear · Smooth · Touch Mapper · Translate
Scenes External Scene · Material Scene
Materials Graph · Touch Material
Scripting Script Function · Script
Comments Comment