Pause screen `isPointerBlocker` is still allowing events outside of the element

I’m trying to block any events from being fired outside my pause screen with isPointerBlocker but it still seems when I’m hovering over an GUI element that’s not attached to the element with the pointer blocker it’s still being triggered, am I doing something wrong?

            this.screenTitle = new PauseScreen();
            this.screenTitle.isPointerBlocker = true;

Could you create a small playground with a repro ? it might be easier to help on it

Yes here it is: Babylon.js Playground

As you can see the pointer is block is attached to the gui element and we’re still able to move the camera outside the UI element (Now thinking about it, I might be confused as to what the logic is) Testing it it seems it stops outside events from firing INSIDE the element, but I’m looking for the opposite.

Yes you should create a transparent rectangle that takes the entire screen :slight_smile:

basically think about the element as cactching and stopping the event to propagate to the scene,

I understand, thank you!

For anyone else that has this issue or needs to handle it like I do:

    class FullScreenInterface extends BABYLON.GUI.Rectangle{
            this.width = "100%";
            this.height = "100%";
            this.isPointerBlocker = true;

            this.onPointerDownObservable.add(function() {
                console.log("hello world");

1 Like