touslecoq Posted November 20, 2016 Share Posted November 20, 2016 Hi folks, @Nockawa As well as making use of the fine Castor.js extension for html based UI, I am wanting to add some webgl UI elements using Canvas2d, specifically mesh labels. I have pretty much got to grips with the basics. However one thing I cannot get to work is changing the visibility of elements at run time. For example allowing the user to toggle labels on and off. I have created a silly demo based on the "labels" playground demo. The red sphere has a label. Hitting the 'Z' and 'X' keys moves the label along the viewport x-axis and this works fine. The ''L' key toggles the .isVisible property of the label but has no effect. Note that this property does work at 'create' time. If you change line 5 to default to 'false' then the label will not be displayed. However then hitting 'L' key does not display it. The key events write to the console log so it looks as though the events are triggering. http://www.babylonjs-playground.com/#1RB7WB#20 Am I doing something wrong or is the isVisible not re-read once created? Thanks Richard Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 20, 2016 Share Posted November 20, 2016 Hiya Richard! Yeah, according to the visibility info doc, isVisible is a getter (to check visibility state). LevelVisible is a boolean to set the visibility. http://www.babylonjs-playground.com/#1RB7WB#21 Party on! Nockawa 1 Quote Link to comment Share on other sites More sharing options...
touslecoq Posted November 21, 2016 Author Share Posted November 21, 2016 Yeehaa :). Thanks Wingy not sure how I missed that but that is exactly what it needed! 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.