is there a quick way to constrain a GUI element to, say, 0.1 units from the bottom and 0.2 units from the right side of the window? Or is the only way to intercept some kind of window-resize event and reset the position?
given a GUI element that has been initialized with the parent= option, how do I retrieve the parent from the element? getParent() retrieves a NodePath but this doesn’t have the methods of the parent GUI element, i.e. parent[“frameSize”]
aButton is now a NodePath object parented to aFrame, another NodePath object. Somewhere inside both NodePath object there still are the two GUI objects, but how do I get to them? Something like:
Note that that creates a circular dependency and the object will never get cleaned up unless you clear the tag.
Or, if you’re certain that tag will be there forever, you could call unref() on the node (be very careful though, weird things may happen).
Thank you ynjh_jo for the tip! I’m surprised I didn’t miss a simple method/attribute that stores the information, but adding an ad-hoc one it’s pretty much as simple.
And thank you pro-rsoft for the warning. It makes perfect sense. I’ll make sure to clear it before I let go of the gui element.