How to use ui.delay()
I can't find any example of how to use ui.delay(). I've tried what seems the obvious simple case below, but the function always runs immediately... without any delay. Can you provide an example please. Thank you, Tony.
import ui import console def funcSome (): console.hud_alert('funcSome') ui.delay(funcSome(), 3)
ccc last edited by
Remove the () so that you are passing the function instead of calling the function.
Change the last line to:
Brilliant, thanks. All is clear, Tony.
... and now you got me started... with a bit of research... I discovered you can do this if you need to pass arguments:
import ui import console from functools import partial def funcSome (a, b): console.hud_alert(a + b) ui.delay(partial(funcSome, 'a', 'b'), 3)