Hi I am using this , but it is showing me error
var advancedTexture = GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
do I have to install something else (eg npm install - babylonjs-gui) to work with babylonjs GUI
Hi I am using this , but it is showing me error
var advancedTexture = GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
do I have to install something else (eg npm install - babylonjs-gui) to work with babylonjs GUI
Did you import the module correctly? You may post the error message or a bit more of your code here…
Import it like this:
import * as GUI from 'babylonjs-gui';
Install via
npm i babylonjs-gui
should be enough though
you may checkout also the es6 module here:
I installed it and calling
var adveancedTexture = GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
but it is showing me these errors —>
babylon.js:1 Uncaught TypeError: Cannot read properties of null (reading ‘_getComponent’)
at new e (babylon.js:1:2864868)
at Function.AdvancedDynamicTexture.CreateFullscreenUI (babylon.gui.js:1731:1)
at Object…/src/index.ts (index.ts:61:1)
at webpack_require (bootstrap:19:1)
at startup:4:1
at startup:5:1
e @ babylon.js:1
AdvancedDynamicTexture.CreateFullscreenUI @ babylon.gui.js:1731
./src/index.ts @ index.ts:61
webpack_require @ bootstrap:19
(anonymous) @ startup:4
(anonymous) @ startup:5
Hi have you already tried calling it like this:
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
?
its working now , have to reinstall the GUI module