Programming Guide
API Reference
moderngl_window.timers.base.
BaseTimer
A timer controls the time passed into the the render function. This can be used in creative ways to control the current time such as basing it on current location in an audio file.
All methods must be implemented.
BaseTimer.
__init__
Initialize self. See help(type(self)) for accurate signature.
next_frame
Get timer information for the next frame.
The frametime and current time
Tuple[float, float]
start
Start the timer initially or resume after pause
pause
Pause the timer
toggle_pause
Toggle pause state
stop
Stop the timer. Should only be called once when stopping the timer.
Tuple[float, float]> Current position in the timer, actual running duration
is_paused
The pause state of the timer
bool
is_running
Is the timer currently running?
time
Get or set the current time. This can be used to jump around in the timeline.
The current time in seconds
float