Jump to content

CreateGUITexture? Is it outdated?


fateriddle
 Share

Recommended Posts

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...
Link to comment
Share on other sites

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};
}

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...