MarginContainer
Padding around a shared content rectangle.
Padding comes from margin_left, margin_top, margin_right and margin_bottom theme constants, for example through AddThemeConstantOverride. It contributes to minimum size and reduces the content area. Separate from the MarginContainer’s own anchors/offsets.
Several direct children receive the same inner area and can overlap. For sequential layout add one VBoxContainer or HBoxContainer and put content inside it.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
MarginContainerConstructor
public MarginContainer();Creates an area padded by theme margin_left/top/right/bottom constants. Put one BoxContainer inside for sequential content.
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
margin_bottomint | Offsets towards the inside direct children of the container by this amount of pixels from the bottom. Default:0 |
margin_leftint | Offsets towards the inside direct children of the container by this amount of pixels from the left. Default:0 |
margin_rightint | Offsets towards the inside direct children of the container by this amount of pixels from the right. Default:0 |
margin_topint | Offsets towards the inside direct children of the container by this amount of pixels from the top. Default:0 |