Godot Version
4.2.1
Question
I’m working on an adjustable UI element that I’m also using with @tool
, which works great so far, with one exception. I’m having trouble being able to know when to refresh it. The key piece of information is that I have a top-level element with my script, and a whole bunch of children and grandchildren.
_draw()
doesn’t seem to happen when I expect.
_process()
works, but I assume that’s heavier than I need it to be. I suppose I could just run this one for the editor.
Any other combination of signals (especially minimum_size_changed
, which is what I thought would work) doesn’t work when I reduce the size of an element.
So, I’ve got a label nested down in my UI. When that changes, bigger or smaller, I want to trigger a refresh on the whole tree. I tried setting up signal handlers on all the elements, but then I have to do that when they enter and exit and it felt like a lot of work to maintain.
So my winning solution at the moment is to use _process()
with a frame cap (i.e. only run the refresh every x frames), but this feels less than ideal.
So the real question is: if I want to know anytime a descendant node has its minimum size changed, is there an elegant way to do that, short of putting a bunch of signal handlers on each one?