Gil Posted September 12, 2017 Share Posted September 12, 2017 Hello everyone, I'm migrating a script from canvas2d to the new gui. So far so good but I still get some questions. For the first question, I made a basic PG. I would like to know if it's possible to have a rectangle that will adjust width and height based on a textblock text size and margins.https://www.babylonjs-playground.com/#XCPP9Y#227 For the second question, I had a button to disable Canvas2D like this : canvasUI.levelVisible = 0; I understand that's not possible with the AdvancedDynamicTexture but is there something I can use to hide everything with one command ? Thanks ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 13, 2017 Share Posted September 13, 2017 Hey! 1.Not directly but you can at least embed the text inside the rect: https://www.babylonjs-playground.com/#XCPP9Y#248 2. just call advancedTexture.rootContainer.isVisible = false; Quote Link to comment Share on other sites More sharing options...
Gil Posted September 13, 2017 Author Share Posted September 13, 2017 Hello @Deltakosh, 1. Alright, thanks. I think I will count the letters to autosize a little the rectangle. 2. Thanks Thanks for the help as always Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 13, 2017 Share Posted September 13, 2017 My pleasure Quote Link to comment Share on other sites More sharing options...
Gil Posted September 19, 2017 Author Share Posted September 19, 2017 Hello, Today I updated the script and now I have to use this : advancedTexture._rootContainer.isVisible = false; To make the whole GUI invisible. That's fine by me but I can't hide the elements inside like before (the debug layer is broken so maybe tomorrow will be better to test further). I was using element.isVisible and set it to true or false to hide it when necessary but I can't edit the value anymore. I also tried on _isVisible but it doesn't work eather. I don't know if gui is broken right now or if I have to do things differently. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 20, 2017 Share Posted September 20, 2017 Hello, I have no open bug regarding either GUI or debug layer. Can you provide repro of the problems in the PG? 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.