-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make a reset method (allows tween reuse in an object pool for example) #302
Comments
I think it is a bit dangerous to talk about 'performance improvements' when we do not really have a baseline benchmark yet. We should focus on getting that one ready before we try to optimise more. |
@mikeBOLD We can reuse tween via reset |
This shouldn't be too hard to implement. A simple reset functionality can reset all state to the same as in the constructor. |
For reference, here is an example that shows a workaround on how to reset a tween (see the https://codepen.io/trusktr/pen/2870d850113cad70f06464e3e0bdb72a |
Closing, as I believe that |
We should allow users to reuse tween objects. This could lead to some performance improvements for advanced users who are willing to set up a memory pool for tween objects. Currently you can reuse a tween if it has the same tweened object. In order to allow full reuse we would need to add a function such as "setObject", or alternatively we could add a new function such as "reset" that would completely reinitialize the tween with a new tweened object. This change could easily break the code, so it would need to be done carefully.
The text was updated successfully, but these errors were encountered: