Jump to content

Canvas2D avoiding intercepting clicks in transparent areas


royibernthal
 Share

Recommended Posts

I have 2 Group2D one on top of the other. Let's say Group A is in front of Group B.

Whenever I'm trying to click on elements in Group B, it seems like their events are not fired, most likely because they are intercepted by Group A. (without Group A they're fired as expected)

Even though Group A is in front of Group B, it doesn't have any elements that hide the elements in Group B, so the elements in Group B are fully visible.

 

I'm pretty sure there should be some parameter for it so that a group doesn't intercept clicks within a transparent area, or something of the sort. Any idea?

Link to comment
Share on other sites

Oh yeah, that's good and broken. (But this is not the issue I expected.  I thought you were trying to click thru the transparent areas of a group, which is layed perfectly atop another.)

This is just broken.  heh

https://www.babylonjs-playground.com/#B6BWYK#4

Click on white 'rectB' in the area HIGHER-THAN yellow 'rectA', = good click.  Click white rectB in area adjacent-to yellow, = dead click. 

Yellow group is blocking clicks... toward LEFT edge of canvas. 

But, with rectB on other side, white rectB clicking is 100% again, when clicking high or low upon it.  RectA also full operational. (when reversed, I expected dead areas in yellow rectA.  Nope, all areas click good.  hmm.)

@Nockawa  Bitte teste dies, wenn du Zeit hast?  Vielen Dank  :)

Link to comment
Share on other sites

24 minutes ago, Wingnut said:

I thought you were trying to click thru the transparent areas of a group, which is layed perfectly atop another.

Basically this is the case in my project, both groups occupy the exact same space and are one on top of the other, I play with their children's coordinates.

https://www.babylonjs-playground.com/#B6BWYK#6

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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