Skip to content

MarginContainer

Eduard Gushchin edited this page Jul 1, 2026 · 3 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.MarginContainer
Namespace Electron2D
Kind class
Category UI and Text

Overview

Places direct child controls inside theme-defined margins.

Syntax

public class Electron2D.MarginContainer : Electron2D.Container

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: MarginContainer

UI container that insets direct child controls using theme margin constants.

Remarks

Margins are read from margin_left, margin_top, margin_right and margin_bottom theme constant overrides. Missing margin constants default to zero.

Thread Safety

This type is not synchronized. Create and mutate it on the main scene thread.

Since

This type is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Container

Members

Member Kind Summary
Electron2D.MarginContainer() Constructor Initializes a new instance of the Electron2D.MarginContainer type.
_GetMinimumSize() Method Gets the minimum size required by this margin container.

Member Details

Electron2D.MarginContainer()

Kind: Constructor

public Electron2D.MarginContainer()

Summary

Initializes a new instance of the Electron2D.MarginContainer type.

Remarks

The new container starts with zero margins until theme constants are overridden.

Thread Safety

This constructor is not synchronized. Call it on the main scene thread.

Since

This constructor is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.AddThemeConstantOverride(System.String,System.Int32)

_GetMinimumSize()

Kind: Method

public Electron2D.Vector2 _GetMinimumSize()()

Summary

Gets the minimum size required by this margin container.

Remarks

Multiple child controls share the same inset rectangle.

Returns

The largest child minimum size plus horizontal and vertical margins.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Container.FitChildInRect(Electron2D.Control,Electron2D.Rect2)

Clone this wiki locally