Theoretical: How could I approach custom containers?

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

I’m most likely going to use Godot’s built-in containers but how could I approach making (in gdscript) my own/custom ones? Where to start? Is it possible not using container related nodes?

From what I understand, container is an area that shows only part of a different object which contains more stuff. Then you can scroll it, resize it and so on…

My current idea of how I see it, is to check if object is visible inside the container area but right from the start I see problems that could occur from containing bigger objects. I tried to do some research but I’m not even sure what to look for.

Thank you for any hints, resources and explanations.

Have you looked at the API for the Container and Control classes? What do you want to do with the custom containers?

Ertain | 2018-02-20 21:26

I basically want to replicate the functionality of container nodes without using container nodes. It’s more of “how does it work” task than something I really really need. I haven’t read API too much. Do not consider me a serious programmer.

MAJOR_KONTROL | 2018-02-20 21:47

Yeah, as I see it, you can add various Control nodes to a base Container, and it will move them, resize them, or just contain them. It basically fits them into a rectangle that is set via the other settings in the user interface, or could even be set programmatically.

Ertain | 2018-02-20 23:44