Clock: a clock with scheduled events
You can add new event like this
def my_callback(dt):
pass
# call my_callback every 0.5 seconds
getClock().schedule_interval(my_callback, 0.5)
# call my_callback in 5 seconds
getClock().schedule_once(my_callback, 5)
If the callback return False, the schedule will be removed.
Bases: object
A clock object, that support events
Get the current FPS calculated by the clock
Get the last tick made by the clock
Schedule a event to be call every <timeout> seconds
Schedule an event in <timeout> seconds
Advance clock to the next step. Must be called every frame. The default clock have the tick() function called by PyMT
Remove a previous schedule event
Return the clock instance used by PyMT