I have a couple of problems with StackPanel3D which leads me to think it is not a real container with function but more of a “virtual” container only involved in refreshing layout. Is this correct or am I doing something wrong?
StackPanel3D.onPointerOutObservable never gets triggered (line 56).
Also setting StackPanel3D.isVisible has no effect on its children, I have to traverse the children and hide them too (see line 68). What about if there are nested panels? That could get quite messy.
Pointer out / hover events are handled with ray picking, so as the StackPanel3D has no geometry it won’t work. Maybe creating a fully transparent geometry for it would work…
Regarding the visibility, you can associate a mesh (even without geometry) with a StackPanel3D by overloading _createNode so that setting its visibility will also update its children visibility:
As a workaround I tried to get the input manager to check if the pointer was over a child control but the input manager constructor is not recognised… https://playground.babylonjs.com/#7UDAI2#2
Is there a simple way around this? I could try adding pointer enter observables to the children to reverse the pointer out of the parent but it is getting messy.
The PG with the situation was linked previously in the thread but strangley I have just gone back to that to post it here and it is now not working. This PG was working a few days ago but isn’t now. It gives some error about cannot read sideOrientation from undefined, I tried to fix that but no luck; https://playground.babylonjs.com/#7UDAI2#4
The behaviour I wanted was not a bubbling of events but rather to suppress onPointerExit from a container control when the pointer enters a child control. I wanted a way of knowing when I left the containers outer bounds (but not when on a child). Does that make sense? I have reworked my scene so I am no longer needing this but it would still be good to know how to do it.
Ah great, thank you. I thought I had tried it without that but obviously I didn’t.
I have adjusted the PG so it now runs. The menu pops up when pointer is over the sphere but then placing the pointer over one of the child buttons fires pointer exit on the plane - this is what I wanted to prevent. PG: https://playground.babylonjs.com/#7UDAI2#5