how to get a Rect2D of a parent node which encloses all children in godot 3.0/3.1

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

How can i compute the Rect2D that i’ve drawn in?
enter image description here

:bust_in_silhouette: Reply From: fpicoral

You would need to draw 4 lines

Add them as child of the same parent so you can use this parent as reference to the points.

Thank you for your answer but the issue i have is not the drawing of lines but the size of the parent.
I want to build a convoy of ships and want to test if the whole convoy has left the screen.
I also want to be able to programatically fill the convoy with ships and do not want to edit every convoys “size box” by hand.

If i could figure out a way to get the size (a Rect2D that encloses all child elements) i could solve my issue with code in process() or with a VisabilityNotifier() but for both i need the size.

In the past i’ve solved this kind of thing with get_rect() but this seems to be gone now.

David Krause | 2019-01-17 11:54