Jump to content

Choose a canvas for GUI.AdvancedDynamicTexture


Dad72
 Share

Recommended Posts

Hi,

How can we choose a canvas to create the GUI?

I have two canvases and if I create an AdvancedDynamicTexture in the first canvas, I can not create one in the second one.

I think that's something missing for BABYLON.GUI

I can choose the scene on the same canvas, but not if we have several canvas.

Link to comment
Share on other sites

No, I'm talking about choosing a canvas to create the GUI, in the case where we have more than one canvas on a page.

The GUI chooses the first available canvas. We can choose the scene but not the canvas.

If I create a GUI in the first canvas, I can not in the second.

Link to comment
Share on other sites

Hi D.  When you say canvas, do you mean renderCanvas?  Each renderCanvas needs separate engine, yes?

So, GUI added with 2nd engine... is put onto 1st canvas? 

If so, strange.  Maybe I don't understand.

http://urbanproductions.com/wingy/babylon/misc/d72dualCanvasGui.zip

Two renderCanvas side-by-side... on same page.  Two engines, two scenes, two <script> elements (perhaps all that stuff is not necessary).

Seven AdvancedDynamicTextures in each scene/canvas.  Wow!   (Not sure why I did that.)  :)  Perhaps only first one is used.

But, I tried to reproduce your issue.  I failed, so far.  This 2-canvas page seems to work properly.

Both scenes in single script?   Not allowed, I think.   See http://doc.babylonjs.com/how_to/gui#advanceddynamictexture

"Please note that only one fullscreen mode GUI is allowed per scene"  *shrug*

Thoughts?  Ideas?  Am I misunderstanding?

Link to comment
Share on other sites

Ok, I just understood my problem. I'm really tired at the moment, it's because of a variable that I set to true when I create my GUI on my first scene, and on my second scene, the variable is also true, so the GUI is not creating.

A really stupid mistake. Thank you Wingnut, it woke me to see that it worked at you.

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...