Event system for actors #1990
Replies: 2 comments 2 replies
-
@romaintailhurat Thanks for the post, I appreciate the kind remark! We've been working hard to get the next version out the door soon! I'd expect what you're doing to work in I'm able to reproduce this issue with the excalibur bits you're using To help with debugging the I'm open to improvement suggestions, perhaps a warning logged if registering a pointer event on an actor with width = 0 or height = 0? We could perhaps add a way for pointers to test either graphic bounds or collider geometry? or both? Let me know what you think and what would have helped you sooner. Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hi @eonarheim ! I finally chose to define the collider shape in the constructor: this.body.collider.shape = Shape.Circle(this.radius); It works perfectly. 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi!
First, congrats for Excalibur, its a wonderful job you've done!
I'm exploring the features, but i'm currently stumbling on the event system for actors.
My goal is simple: i designed a Planet class that inherit from Actor, and i want this to listened to actor pointer event.
My implementation is here.
I'm using the
onInitialize
method to enable pointer events, and then i register a function to thepointerup
event.But this doesn't work, no click on the visual object triggers this event.
What am i doing wrong ?
Maybe the way i instantiate the classes is wrong ?
Beta Was this translation helpful? Give feedback.
All reactions