Babylon.js: GUI.Image onPointerDown is throttled and onPointerClick doesn't work at all

Created on 18 Apr 2019  路  7Comments  路  Source: BabylonJS/Babylon.js

Hello,

I've noticed that in the last few versions there has been a change in how pointer events work.

  • onPointerDown is throttled (try clicking on the image few times and see that the event only fire once or twice)
  • onPointerClick doesn't work at all

see this playground for your self.
(open console, press few times on the image and see that click event never fires, and down event fire only once).

reproduced on: Chrome version 73.0.3683.103 running on OSx.

Thanks!

bug gui

Most helpful comment

Doc fixed!

All 7 comments

@TrevorDev maybe related to your latest change on the pointers

Seems to only affect non-button controls

yep for some reasons the _enterCount seems off

hahaha I'm just tired :)
As the imge is not a pointer blocker, it does not register to all events:)

Just add image.isPointerBlocker = true; and it will work :)
https://www.babylonjs-playground.com/#XCPP9Y#1051

I managed to get confused (nothing unusual) since it works in 3.3 without isPointerBlocker
maybe a line should be added to the docs how_to/gui#events section
"controls must have isPointerBlocker = true" or w/e

Yeah that changed because 3.3 was a bit messy when dealing with scene interaction.
I will definitely add that info in the doc

Doc fixed!

Was this page helpful?
0 / 5 - 0 ratings