Skip to content

'pointerdown' event listener triggered for multiple Actors #3140

Answered by eonarheim
Zoobdude asked this question in Q&A
Discussion options

You must be logged in to vote

@Zoobdude This is a good question!

I think what's happening is the built in pointer system is using the bounds of the line, not the pixels of the line to determine whether to send the pointerdown event to the actor. By default in the latest excalibur both the collision geometry and the graphics AABB will but used for clicks.

I think there are 2 options in the current state:

  1. Add some collider that would represent the clickable area of the line, and toggle off actor.pointer.useGraphicsBounds = false. This might be the easiest?

  2. Use the current setup but do some additional processing. Because you will a bounding box around the graphic, youhave false positives but no false negatives on lin…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@eonarheim
Comment options

@Zoobdude
Comment options

Answer selected by Zoobdude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants