jacobf

Best way to make GUI block onPointerObservable()

Recommended Posts

Hi,

I'm looking for a way to block events coming to onPointerObservable() when the pointer is interacting with GUI elements.

Is there a way to do a hit test for POINTERDOWN or something simpler than adding an on onPointerEnter/onPointerOut to every GUI control?

Share this post


Link to post
Share on other sites

Hi there.  https://www.babylonjs-playground.com/#1I4Y2F#1

Just a (badly-acting) testing playground, if needed.

Can I ask WHY you want to block enter/out/down/up events... on any GUI controls?

Are you trying to make picks/clicks...sometimes "get through" to mesh/nodes behind the GUI?

Just curious.

14 hours ago, jacobf said:

something simpler than adding an on onPointerEnter/onPointerOut to every GUI control?

I assume you mean.. adding enter/out events to GUI rectangles that you wish to use as custom buttons.  (creating rectangles that ACT like buttons)  *nod*

Generally speaking, there is likely a way to do what you wish, without needing to make custom buttons, OR block standard events on simpleButtons.

Tell us some more details, if you please.  Build us a better playground... teach us what you wish to do.  We might be able to solve your issue with some .isForeground, .isBlocking, and/or .isPickable flags.

Share this post


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

  • Recently Browsing   0 members

    No registered users viewing this page.