Borjan Posted July 12, 2017 Share Posted July 12, 2017 Hiding and showing controls by using isVisible (like a Rectangle in this case) works if the control is not linked to a mesh by linkWithMesh. Once it is attached, the control stays visible. The inner controls (in my case the text inside the rectangle) can be hidden. See the playground https://www.babylonjs-playground.com/index.html#RBP60B#6 lines 35-42. Quote Link to comment Share on other sites More sharing options...
Samuel Girardin Posted July 12, 2017 Share Posted July 12, 2017 Hi , On a simple playground, it doesnt work too http://www.babylonjs-playground.com/#XCPP9Y#147 Quote Link to comment Share on other sites More sharing options...
Samuel Girardin Posted July 12, 2017 Share Posted July 12, 2017 In advancedDynamicTexture.ts or the whole js file Around line 205. You can add. Maybe I'm wrong. It seems to fix the pb. if (projectedPosition.z < 0 || projectedPosition.z > 1 ) { control.isVisible = false; continue; } // add this above the first if if (!control.isVisible) { continue; } Quote Link to comment Share on other sites More sharing options...
Borjan Posted July 13, 2017 Author Share Posted July 13, 2017 10 hours ago, Samuel Girardin said: In advancedDynamicTexture.ts or the whole js file Around line 205. You can add. Maybe I'm wrong. It seems to fix the pb. if (projectedPosition.z < 0 || projectedPosition.z > 1 ) { control.isVisible = false; continue; } // add this above the first if if (!control.isVisible) { continue; } Thanks Samuel, looking into your example: https://www.babylonjs-playground.com/#ZI9AK7#21 I've figured out that the hiding in your case works due to the way how you instantiate the texture: advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh(plane); while I do: advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("ui1"); As I'm really not proficient with 3D programming, I do not understand the difference - will read the documentation one of these days. I would prefer not to change the js library - it goes far beyond my knowledge - until 2 weeks ago I've never programmed java script ... For me would be simpler not to use CreateFullscreenUI for the time being and wait till the fix becomes a part of the release. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 13, 2017 Share Posted July 13, 2017 I'll push a fix on the preview branch today THanks for reporting it 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.