-
Notifications
You must be signed in to change notification settings - Fork 18
pyux.set_timer_handler
fabian-flassig edited this page Jul 8, 2026
·
5 revisions
Sets up a timer and its handler function for timed-events in the current modal scope. A call to [pyux.start_timer] is required to set the frequency and start the newly created timer.
pyux.set_timer_handler(handler)
pyux.set_timer_handler(handler, existing_timer)| Type | Description | |
|---|---|---|
handler |
function |
A lua function that is invoked when the timer event occurs. nil will remove the handler. |
existing_timer |
timer_token |
Identifier of an existing timer |
| Type | Description |
|---|---|
timer_token |
A value that should be passed to pyux.start_timer to identify the timer |
The parameters to the handler function are as follows:
function on_timer_handler(info)| Type | Description | |
|---|---|---|
info |
{...} |
A table containing the following key-value pairs: |
info.timer_id |
timer_token |
Matches the return value of set_timer_handler
|
This timer is specific to the current modal scope.
To delete an existing timer, call pyux.set_timer_handler(nil, existing_timer). All remaining timers are automatically cleaned up at the end of the modal scope.
Use pyux.start_timer to start the timer and pass the timer_token.
To create fluid animations in 3D space, animations should be preferred! Their frequency is automatically adjusted to the capabilities of the user system.
Minimum PYTHA Version: V26