Hi, I realise this is a super old plugin but in the latest Gideros the tntAnimator seems to have stooped working. Anyone know if there's an easy fix? Else I guess I'll have to convert to using movie clips or something
For those who are interested I made some additions to use callbacks instead of events: it actually handles both but uses callbacks if provided. Usage is similar to the default tntAnimator addEventListener call:
localfunction myCallbackFunction(e)print(e.animationName, e.previousAnimationName )end--action = "add" "remove" and "clear" --event = ANIM_CHANGE, ANIM_START... (tntanimator events)--callback = function to trigger on event: same values of default tnt events are returned:--ie:
self.anim:callbackDo("add", "ANIM_CHANGE", myCallbackFunction )--add callback on "ANIM_CHANGE"
self.anim:callbackDo("remove", "ANIM_CHANGE")--remove callback on "ANIM_CHANGE"
self.anim:callbackDo("clear")-- removes every defined callback for this tnt object
Hi, right now tntanimator does a bunch of work adding and removing one Enterframe event for each instance of CTNTAnimator (it uses this trick also to set animations on play/pause).
I tried "fixing" this behaviour: I made some modification to use only one enterframe listener (which calls every enabled animation) and it seems to work so far.. it is a bit faster than original on my tests, but I haven't tested it deeply. Please tell me if you try it and have unexpected results/leaks and bugs no action is needed, just replace the library in your project.
edit: updated file with small addition. CTNTAnimator:free(true) should remove everything that may be left behind to be garbage collected.
Comments
Likes: SinisterSoft
what do you think ?
Likes: SinisterSoft, pie, totebo, n1cke, talis, chuz0, simwhi, muro
www.tntengine.com
enjoy \m/
B-)
Likes: muro, pie, n1cke, totebo
www.tntengine.com
For those who are interested I made some additions to use callbacks instead of events: it actually handles both but uses callbacks if provided.
Usage is similar to the default tntAnimator addEventListener call:
Likes: GregBUG
I tried "fixing" this behaviour:
I made some modification to use only one enterframe listener (which calls every enabled animation) and it seems to work so far.. it is a bit faster than original on my tests, but I haven't tested it deeply.
Please tell me if you try it and have unexpected results/leaks and bugs
no action is needed, just replace the library in your project.
edit: updated file with small addition.
CTNTAnimator:free(true) should remove everything that may be left behind to be garbage collected.
Likes: muro, GregBUG