Dad72 Posted January 25, 2018 Share Posted January 25, 2018 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. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 maybe make two containers for the UI elements, and when you switch scenes change container visibility. I think you can have only one GUI instance running. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 25, 2018 Share Posted January 25, 2018 does what was done in the demo not work (layerMask)? http://www.babylonjs.com/demos/gui/ ie: // Another GUI on the right var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI"); advancedTexture.layer.layerMask = 2; Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 26, 2018 Author Share Posted January 26, 2018 layer.layerMask = 2; seems to be the solution. Thanks Brianzinn GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 27, 2018 Author Share Posted January 27, 2018 In fact no, layer does not solve the problem. It works with a single canvas, if you have more, this is the first canvas find that is used. Quote Link to comment Share on other sites More sharing options...
mecanicus Posted January 27, 2018 Share Posted January 27, 2018 Is it something like this? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 27, 2018 Author Share Posted January 27, 2018 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. Quote Link to comment Share on other sites More sharing options...
mecanicus Posted January 27, 2018 Share Posted January 27, 2018 Sorry i can't help you Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 27, 2018 Share Posted January 27, 2018 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? Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 27, 2018 Author Share Posted January 27, 2018 I look at your zip and I do not understand what does not work at home since it works at you. I will look at what can create the problem on my project. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 27, 2018 Author Share Posted January 27, 2018 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. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 27, 2018 Share Posted January 27, 2018 Excellent! My pleasure. I was hoping you would say this. Sorry that you lost dev time. Be well, party on. Dad72 and GameMonetize 2 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.