Timers - SmallSquareStudios/Psych-Engine-Wiki-Extra GitHub Wiki

Please note that starting a timer with a tag of a currently running timer will cancel that running timer.

Starting Timers

runTimer(tag:String, ?time:Float = 1, ?loops:Int = 1)

Runs a timer for a specified duration and loop count.

tag - The name of the timer, it will be used in a callback of onTimerCompleted(tag, loops, loopsLeft) when it has finished.

time - Optional value, how much time it takes to finish a loop in seconds. Default value is 1.

loops - Optional value, how many times it should loop. does a callback of onTimerCompleted(tag, loops, loopsLeft) for every time it loops.

Cancelling Timers

cancelTimer(tag:String)

Cancels a timer using the tag.