fateriddle Posted October 25, 2018 Share Posted October 25, 2018 https://playground.babylonjs.com/#22KIIK In this playground, I see use of "createGUITexture" a lot, but when plug into my code, it seems createGUITexture is not a function... why? I've tried import * as BABYLON from 'babylonjs' import * as GUI from 'babylonjs-gui' import 'babylonjs-loaders' GUI.createGUITexture( ... ) BABYLON.createGUITexture( ... ) But it seems none of the namespace has this method... Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 25, 2018 Share Posted October 25, 2018 Hi.. It's a javascript function declared in the PG, not a part of babylonJs GUI. function createGUITexture(planeName, planeSize, planePosition) { var plane = BABYLON.Mesh.CreatePlane(planeName, planeSize, scene); plane.position = planePosition; var GUITexture = BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh(plane); return { GUITexture: GUITexture, plane: plane}; } 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.