MarginContainer

Inherits: Container < Control < CanvasItem < Node < Object

Simple margin container.

Description

Adds a top, left, bottom, and right margin to all Control nodes that are direct children of the container. To control the MarginContainer’s margin, use the margin_* theme properties listed below.

Note: Be careful, Control margin values are different than the constant margin values. If you want to change the custom margin values of the MarginContainer by code, you should use the following examples:

var margin_value = 100
set("custom_constants/margin_top", margin_value)
set("custom_constants/margin_left", margin_value)
set("custom_constants/margin_bottom", margin_value)
set("custom_constants/margin_right", margin_value)

Theme Properties

intmargin_bottom0
intmargin_left0
intmargin_right0
intmargin_top0

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.