Jump to content

GUI element's visibility/existence


Recommended Posts


Short question: When we set control.isVisible = false to a GUI element - does that mean, that element still exists, but is fully transparent or it is not being calculated at all (just like setEnabled(false) for meshes)?

Maybe stupid question, I think the second should be correct, but just to clarify :)

Link to comment
Share on other sites

.notRenderable... hunh... yeah, that works fine... good find.

hmm.  I'm really not qualified to "think about" too much.  Let's watch for more-informed answers about .notRenderable().

Off the top of my head, I would say... that the source code we are looking-at... is NOT "for" the current build that's being used in the playground.

Speculation, though.  I'm really only qualified to help with simple things.  You are asking complicated things that I USUALLY answer incorrectly (Wingnut foot in mouth)  :)

Link to comment
Share on other sites

Hello team!!

this should be in the doc, my bad :(

* notRenderable will only hide (not draw) the current control

* isVisibile = false will not render the control and all its children

Link to comment
Share on other sites

@alexoy - I don't think "attached" is a good word to use, there.  :) "added" is better.  Notice which controls are containers, and which not.  Also, as you use BJS GUI more and more, you will do console.log(somecontainer.children), fairly often, especially if you like to examine GUI controls in the browser F12 dev-tools OBJECT INSPECTOR.  There, you just click the children property and you can see all the controls that you have "added" to a container, or to the ADT itself, which is also a container, of course.

But yes, your example is correct.  Rectangle is a container... often used to put a border around anything inside.  But stackpanels, too... and later... if you build GUI tables/lists... you'll likely have vertical stackpanels full of horizontal stackpanels full of rectangles full of (user-interaction/content-)controls.  Containers of containers of containers... ad nauseum.  :)

That's my take.  Delta might have different words.

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