Jump to content

click through dom elements


djo
 Share

Recommended Posts

hi all

I've run into a problem that bugs me.

it seems that clicking through DOM elements triggers the events of any pixi element that's underneath.

ok well, why not.

but it seems that it triggers events even if there's no pixi renderer underneath.

here's my problem (see linked images) :

the pixi renderer is where the image is.

1. initial setup, nothing's under nothing, everything is in its place.

2. I move the background to the left, and triggers addSprite to the background (background .onpointerup)

3. I trigger my menu's "move background" events so I can move back my background into place (I click on the arrows icon), and proceed with moving the background to the right

4. we can clearly see that clicking on the arrows added another sprite on the background at the icon position, where the renderer did not exist. only the background was there, but outside of the renderer's view.

 

I tried correcting this by using the hitArea and defining it for the background at every move and zoom (so it matches exactly with the renderer frame), but it sometimes go off and I'd rather use the native displayObject move bounds.

do you have any idea on what's going on ?

 

thanks,

 

djo

 

 

1.jpg

2.jpg

3.jpg

4.jpg

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...