documentation index ◦ reference manual ◦ function index

# ui.timer

Function: | ui.timer | (seconds, function, repeat=False, args=(), kwargs={}):

This sets up a timer that will call function after seconds seconds have elapsed. If repeat is true, then the function is called every seconds seconds thereafter.

args and kwargs are the positional and keyword arguments supplied to the function, respectively.

## Example

    # Jump to too_slow if the next interaction lasts longer than 30 seconds. Note that
    # this is a really bad thing to do in menus, since people may read your game at
    # different paces.

    $ ui.timer(30.0, ui.jumps("too_slow"))

documentation index ◦ reference manual ◦ function index