bali33 Posted April 16, 2015 Share Posted April 16, 2015 Hi I'm new to phaser and so far is great. I was wondering if it would be worth considering adding new Sprite events/signals like "update" and "onDragUpdate" which I think could be very helpful when developing games. What do you think guys ? Thank you Link to comment Share on other sites More sharing options...
Pooya72 Posted April 16, 2015 Share Posted April 16, 2015 See if events in this example are what you want http://phaser.io/examples/v2/input/drag-event-parameters Link to comment Share on other sites More sharing options...
rich Posted April 17, 2015 Share Posted April 17, 2015 Sprites have empty update methods which you can override as needed. You can add whatever code you want in there (and should do so!). I won't ever make a Sprite emit an update event though - just because it could potentially flood the system as most Sprites update 60 times per second, multiply that by all of your sprites and that's a titanic butt-load of events being generated every frame. If you just want to monitor a sprite while it's being dragged then you should use the InputManagers addMovementCallback function. It's still quite high frequency but ONLY during movement events, so much safer to hook in to. Link to comment Share on other sites More sharing options...
Recommended Posts