ZoomBox Posted July 3, 2014 Share Posted July 3, 2014 Hello !I would like to know what would be the best way to remove a tween callbackFor exemple, I set a callback function "myFunction" onLoop or onComplete:tween.onLoop.add(myFunction, param);Then I would like to do something like this;tween.onLoop=undefined;(obviously, this doesn't work) Edit: And without stopping the tween Link to comment Share on other sites More sharing options...
lewster32 Posted July 3, 2014 Share Posted July 3, 2014 I believe you'd simply do it like this:// addtween.onLoop.add(myFunction, this);// removetween.onLoop.remove(myFunction, this);This should be true of all Phaser's 'events' as they are all based on Signals. See Signal.remove for more. ZoomBox 1 Link to comment Share on other sites More sharing options...
ZoomBox Posted July 4, 2014 Author Share Posted July 4, 2014 Yes, thank you, but I would like to remove the callback without knowing it.Something like removeAll(). Edit: Haha, thank you for guiding me to the Signal class, removeAll() exists :-D lewster32 1 Link to comment Share on other sites More sharing options...
Recommended Posts