Sudoku

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

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?

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.