Jump to content

GUI - Rectangle autosize from child + full hide


Gil
 Share

Recommended Posts

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 !

Link to comment
Share on other sites

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.

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