Jump to content

How to set bGUI to run in a seperate script


Recommended Posts


This post is probably for @Temechon, but perhaps there are other users who have accomplished this. I need to seperate out the bGUI elements from my main.js script, as bGUI sets up the canvas size by default. Also, I'm unable to access scene elements if I use the bGUI demo as a template. Even if I run a render loop, I can't seem to make changes to properties such as the visibility of a scene object or other element properties with a "click" function of a bGUIButton when I use a global variable inside of the "function init3d (scene, canvas)".

I'm able to do this is I declare my scene objects following the bGUI.GUISystem initilization, but I really need to seperate the bGUI system into a seperate script from the script containing my babylon.js scene objects. Unless there is a better method to cause change to babyln.js object properties in perhaps a render loop - which I've been able to achieve, but not to any necessary degree of control.

My scripts are many and large, and I'm unable to set up a playground scene to accomplish what I'm currently doing. Any help is appriciated.



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.

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.


  • Recently Browsing   0 members

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