Click or drag to resize

ControlSetMarginsPreset Method

Sets the margins to a preset from ControlLayoutPreset enum. This is code equivalent of using the Layout menu in 2D editor.

Use parameter resize_mode with constants from ControlLayoutPresetMode to better determine the resulting size of the Control. Constant size will be ignored if used with presets that change size, e.g. PRESET_LEFT_WIDE.

Use parameter margin to determine the gap between the Control and the edges.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public void SetMarginsPreset(
	ControlLayoutPreset preset,
	ControlLayoutPresetMode resizeMode = ControlLayoutPresetMode.Minsize,
	int margin = 0
)

Parameters

preset
Type: GodotControlLayoutPreset

[Missing <param name="preset"/> documentation for "M:Godot.Control.SetMarginsPreset(Godot.Control.LayoutPreset,Godot.Control.LayoutPresetMode,System.Int32)"]

resizeMode (Optional)
Type: GodotControlLayoutPresetMode

[Missing <param name="resizeMode"/> documentation for "M:Godot.Control.SetMarginsPreset(Godot.Control.LayoutPreset,Godot.Control.LayoutPresetMode,System.Int32)"]

margin (Optional)
Type: SystemInt32

[Missing <param name="margin"/> documentation for "M:Godot.Control.SetMarginsPreset(Godot.Control.LayoutPreset,Godot.Control.LayoutPresetMode,System.Int32)"]

See Also