azerion / phaser-spine

A plugin for Phaser 2 that adds Spine support
MIT License
121 stars 57 forks source link

How to use events? #20

Closed shibekin69 closed 7 years ago

shibekin69 commented 7 years ago

Hi AleBles,

How do you listen for events from spine objects?

AleBles commented 7 years ago

There is currently no code that handles events created in the Spine GUI, but it should be fairly easy to add

sebas86 commented 7 years ago

@shibekin69, please look at this small change https://github.com/orange-games/phaser-spine/pull/39. You can also utilize track returned by Spine.setAnimationByName and Spine.addAnimationByName – both methods return spine.TrackEntry and this object has onEvent member which is function reference – just set your callback.

shibekin69 commented 7 years ago

Ah! Thanks for the heads up on this one @sebas86 :)

AleBles commented 7 years ago

And that got merged, closing this now. Feel free to re-open if anything is wrong/missing