https://www.babylonjs-playground.com/#VE33T#6 ref Show a popup when the mouse touch a 3d object - #9 by ob1
This seems to be the cause:
by @flux159
The PG is bugged in the first place. It should not be:
butt1 = new BABYLON.GUI.Button.CreateSimpleButton("butt"+i, "");
but:
butt1 = BABYLON.GUI.Button.CreateSimpleButton("butt"+i, "");
Javascript is forgiving and by chance it is (was) working, but you would have had an error with Typescript with the first syntax.
2 Likes
Yep, the reason I updated to this
is because it works for subclasses of Buttons as well (ie the FocusableButton added) - updating to use the fix that @Evgeni_Popov suggested is the correct - https://www.babylonjs-playground.com/#VE33T#22
CreateSimpleButton is a static function of Button & shouldn’t use a new constructor.
@Evgeni_Popov had a pull request to change this
back to Button
at one point in Fix static helpers of the Button class by Popov72 · Pull Request #9516 · BabylonJS/Babylon.js · GitHub, but wasn’t landed.