-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tween callback params #14
Comments
Hi! I preferred to avoid params and/or specific parameter in order to have a cleaner and more usable method signature for callbacks. You can still pass the tween itself via lambda/closures, as long as you assign the callback after assigning the tween. Cheers! |
I'm just worried about the overhead of closures, for example if you add callbacks with element closure in the loop for move a array of elements. |
I totally understand your worries, but it's better to have closures than to have to worry about having tweens that are too heavy, since every callback adds around 4B to the tween itself, even if unused. So closures seem to me like the best necessary evil. I'll ponder about this more though: let me know if you have more thoughts. |
Closures doesn't work if use OnComplete in a for loop. |
Hi @Demigiant, is there any solution to make it gc free without using lambda/closures or params[]? |
Ahoy! |
Hi!
I saw in the documentation that the transfer parameters in the callback goes through lambda/closures.
But why not add a transfer custom parameters (eg params[])? Sometimes closures are not desirable. In addition, it would be helpful to have in the callback information about Tween who raised him.
Thanks!
The text was updated successfully, but these errors were encountered: