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

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.