HI,
Just joined, been experimenting with Babylon.js for a month or so now. I tried to copy some code from the playground ( https://playground.babylonjs.com/#AY28VL#4 ) to my machine and run it but the GUI.js file doesn’t seem to be loading correctly.
Here’s the code where it blows up:
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");
var colorArray = ["white", "blue", "green", "black", "red"];
// Activate the clipboard events listener
advancedTexture.registerClipboardEvents();
With the error:
“Uncaught TypeError: advancedTexture.registerClipboardEvents is not a function”
Do I have to use npm and install BABYLON.GUI.js to use the GUI library?
Do I have to install webpack too?
What I tried was
which works for babylon.max.js but not the GUI…
(Been trying to learn npm and import/export but haven’t got there yet.)
thanks, that does work but fails when I change “//preview…” to “//cdn…”
for example:
"src=‘https://preview.babylonjs.com/gui/babylon.gui.js’ "
to
"src=‘https://cdn.babylonjs.com/gui/babylon.gui.js’ "
Also, when I download these files to my local wwwroot directory the preview files work but the cdn files fail.
Error: ClipboardText.html:97 Uncaught TypeError: advancedTexture.registerClipboardEvents is not a function
The variable “advancedTexture” is a valid instantiated object and I can see all it’s properties, but “registerClipboardEvents” does not exist in the babylon.gui.js file as loaded into the browser. (I’m using Chrome)
Does that suggest an error in the UniversalModuleDefinition ???