Table of Contents

Class SplitContainer

Namespace
Godot
Assembly
GodotSharp.dll

A container that accepts only two child controls, then arranges them horizontally or vertically and creates a divisor between them. The divisor can be dragged around to change the size relation between the child controls.

public class SplitContainer : Container, IDisposable
Inheritance
SplitContainer
Implements
Derived
Inherited Members

Constructors

SplitContainer()

public SplitContainer()

Properties

Collapsed

If true, the dragger will be disabled and the children will be sized as if the SplitOffset was 0.

public bool Collapsed { get; set; }

Property Value

bool

DragAreaHighlightInEditor

Highlights the drag area Rect2 so you can see where it is during development. The drag area is gold if DraggingEnabled is true, and red if false.

public bool DragAreaHighlightInEditor { get; set; }

Property Value

bool

DragAreaMarginBegin

Reduces the size of the drag area and split bar split_bar_background at the beginning of the container.

public int DragAreaMarginBegin { get; set; }

Property Value

int

DragAreaMarginEnd

Reduces the size of the drag area and split bar split_bar_background at the end of the container.

public int DragAreaMarginEnd { get; set; }

Property Value

int

DragAreaOffset

Shifts the drag area in the axis of the container to prevent the drag area from overlapping the ScrollBar or other selectable Control of a child node.

public int DragAreaOffset { get; set; }

Property Value

int

DraggerVisibility

Determines the dragger's visibility. See SplitContainer.DraggerVisibilityEnum for details. This property does not determine whether dragging is enabled or not. Use DraggingEnabled for that.

public SplitContainer.DraggerVisibilityEnum DraggerVisibility { get; set; }

Property Value

SplitContainer.DraggerVisibilityEnum

DraggingEnabled

Enables or disables split dragging.

public bool DraggingEnabled { get; set; }

Property Value

bool

SplitOffset

The initial offset of the splitting between the two Controls, with 0 being at the end of the first Control.

public int SplitOffset { get; set; }

Property Value

int

Vertical

If true, the SplitContainer will arrange its children vertically, rather than horizontally.

Can't be changed when using HSplitContainer and VSplitContainer.

public bool Vertical { get; set; }

Property Value

bool

Methods

ClampSplitOffset()

Clamps the SplitOffset value to not go outside the currently possible minimal and maximum values.

public void ClampSplitOffset()

EmitSignalDragEnded()

protected void EmitSignalDragEnded()

EmitSignalDragStarted()

protected void EmitSignalDragStarted()

EmitSignalDragged(long)

protected void EmitSignalDragged(long offset)

Parameters

offset long

GetDragAreaControl()

Returns the drag area Control. For example, you can move a pre-configured button into the drag area Control so that it rides along with the split bar. Try setting the Button anchors to center prior to the reparent() call.

$BarnacleButton.reparent($SplitContainer.get_drag_area_control())

Note: The drag area Control is drawn over the SplitContainer's children, so CanvasItem draw objects called from the Control and children added to the Control will also appear over the SplitContainer's children. Try setting MouseFilter of custom children to Ignore to prevent blocking the mouse from dragging if desired.

Warning: This is a required internal node, removing and freeing it may cause a crash.

public Control GetDragAreaControl()

Returns

Control

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

Events

DragEnded

Emitted when the user ends dragging.

public event Action DragEnded

Event Type

Action

DragStarted

Emitted when the user starts dragging.

public event Action DragStarted

Event Type

Action

Dragged

Emitted when the dragger is dragged by user.

public event SplitContainer.DraggedEventHandler Dragged

Event Type

SplitContainer.DraggedEventHandler