Vorion Posted August 6, 2018 Share Posted August 6, 2018 Hi, I wanted to try the latest preview release, but my IDE says that "Image" does not exist on type "typeof GUI". By looking at the available types from the GUI, the IDE suggests GUIImage, so I replaced everything with GUIImage. Now I get a console error in my browser, saying "TypeError: BABYLON.GUI.GUIImage is not a constructor". I get the same error on the playground, which btw also suggests GUIImage. By looking at the source code, I think this was intentional, but it isn't mentioned in the what's new file for the preview release. You can see the error on the playground https://www.babylonjs-playground.com/#K60448#22 Is this a bug, or do I need to change something else to get it working? Thanks. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted August 6, 2018 Share Posted August 6, 2018 Hi @Vorion It's GUI.Image, not GUI.GUIImage https://www.babylonjs-playground.com/#K60448#23 Woops, happens when you don't read everything ? Quote Link to comment Share on other sites More sharing options...
royibernthal Posted August 6, 2018 Share Posted August 6, 2018 I just upgraded to the latest version and encountered this issue as well. The problem is that the class is defined as GUIImage in the .d.ts now for some reason, while the actual js still defines the class as Image. I simply changed it manually in the .d.ts for now, but I suppose it should be fixed. https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/gui/babylon.gui.d.ts Quote Link to comment Share on other sites More sharing options...
Vorion Posted August 6, 2018 Author Share Posted August 6, 2018 Thanks for the reply. Just saw that it was changed in this commit about a month ago https://github.com/BabylonJS/Babylon.js/commit/56b22596f0649336fed094df319f9187c244a1f1#diff-d65f22b9bdc1d52cee1b465fc49604c0 Quote Link to comment Share on other sites More sharing options...
Guest Posted August 6, 2018 Share Posted August 6, 2018 yep this is an issue with our new module system. I'll fix that! Quote Link to comment Share on other sites More sharing options...
DylanD Posted August 6, 2018 Share Posted August 6, 2018 12 minutes ago, Deltakosh said: yep this is an issue with our new module system. I'll fix that! new module system? I will pm you. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 6, 2018 Share Posted August 6, 2018 It is already in place The plan is to offer ES6 support for GUI for 3.3 and for the entire framework for 3.4 royibernthal 1 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted August 6, 2018 Share Posted August 6, 2018 Sounds great Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.