Do you know if there is an easy way to pass some arguments to a function called via
haxe.Timer.delay(func, delay);
By "easy" I mean without creating any custom timer.
Do you know if there is an easy way to pass some arguments to a function called via
haxe.Timer.delay(func, delay);
By "easy" I mean without creating any custom timer.
Everything can be achieved with an extra level of indirection :-)
It seems like you need a closure whose only job is to call the other function with arguments.
Something like this (untested):
haxe.Timer.delay(function () {
func(arg1, arg2);
}, delay);
this
and all). –
Digged delay
in in milliseconds (eg. 1000
produces a one second delay). –
Biflagellate © 2022 - 2024 — McMap. All rights reserved.