Jump to content

babylon GUI image: pointerevents not triggered if the viewport height is smaller than 1


Sudoku
 Share

Recommended Posts

Hi together,

i have some problems with the babylon GUI Image Observables for pointer events:

if my viewport height is lower than 1 the pointerevents are not catched at the right position

I will share two playgoundexamples:

This works: https://www.babylonjs-playground.com/#K60448#28

This doesn't work: https://www.babylonjs-playground.com/#K60448#29

 

Did i forget to set an attribute?

Link to comment
Share on other sites

could you have a look at those two playground examples as well?

 

the first example works fine while in the second example i added a second viewport and than the events are triggered slightly above the image.

does works: https://www.babylonjs-playground.com/index.html#K60448#33

doesn't work: https://www.babylonjs-playground.com/index.html#K60448#32
 

Link to comment
Share on other sites

This is not a bug per se. This is because you render the UI twice (once per camera) but the UI has only one state (so the latest camera wins).

I would recommend making sure that UI is not rendered on the second camera by using layerMasks

Link to comment
Share on other sites

the missing hint - thank you! :)

 

just in case someone has a similar setup:
i need to render the GUI elements in every viewport, but i just need to change the order in which the cameras are stored within activeCameras depending on the pointerposition and than the interaction with the labels works as expected.

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