Jump to content

[Feature request] adding new Sprite events


bali33
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...