Frustrating over custom tooltips grow flags.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Inces

I don’t understand these Control nodes.

I have custom tooltip, it is Panel Container > VerticalContainer>a lot of labels and Hcontainers with labels. I am trying to make it expand to the screen in a way it is always visible. So I detect quadrant of the screen and set grow direction flags - if x or y is greater then half of screen - GROW BEGIN. But every time it is supposed to grow to BEGIN and not END, visually it centers tooltips axis on mouse position, just like it would be GROW BOTH in editor. I get it that I should adapt anchor, pivot or global_position in some way. But whatever works in editor, it doesn’t work in code in runtime. I suppose the problem is that flags can only be changed before tooltip grows, and tooltip gets information about its total size only after ready function, when all labels are filled. And after ready() it seems like tooltip no longer reacts to changing of rect_pivot or anchors.

I am pretty sure I am missing some basics about pivots and growing flags. Please somebody enlight me.