ViewPortContainer how to access this with code?

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

I want to access the viewport container’s> Size Flags > Horizontal > Expand via gdscript.

I can’t find how to do this with Doc. Both online docs and Godot engine’s documentation is missing info regarding this. Does anyone know.

A screenshot below if you didn’t fully understand my question.
enter image description here
When I did $ViewportContainer.size_flags_horizontal did come up but after that when I do a . and nothing appears after that. And the documents don’t have a size_flags_horizontal either. Any ideas?

:bust_in_silhouette: Reply From: the_maven

ViewportContainer inherites up from Control node.

Here’s the API reference:
Control — Godot Engine (stable) documentation in English.

The flag part is just of the Methods.

the_maven | 2022-07-14 12:04

Thank you! I kinda saw this but didn’t know how to use it. And after some experimentation I figured it out.

Skydome | 2022-07-14 20:07

:bust_in_silhouette: Reply From: Skydome

$viewportcontainer.size_flags_horizontal = the value can be 1 for just fill, 2 for expand, 1 for fill and expand, 4 for Shrink center, 8 for shrink end.

Similarly there is also size_flags_vertical.