Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- BaseButton (3)
- ColorRect
- Container (13)
- GraphEdit
- ItemList
- Label
- LineEdit
- MenuBar
- NinePatchRect
- Panel
- Range (6)
- ReferenceRect
- RichTextLabel
- Separator (2)
- TabBar
- TextEdit (1)
- TextureRect
- Tree
- VideoStreamPlayer
- AspectRatioContainer
- BoxContainer (2)
- CenterContainer
- EditorProperty
- FlowContainer (2)
- GraphElement (2)
- GridContainer
- MarginContainer
- PanelContainer (2)
- ScrollContainer (1)
- SplitContainer (2)
- SubViewportContainer
- TabContainer
Table of contents
-
var collapsed: bool = false -
var drag_area_highlight_in_editor: bool = false -
var drag_area_margin_begin: int = 0 -
var drag_area_margin_end: int = 0 -
var drag_area_offset: int = 0 -
var dragger_visibility = DRAGGER_VISIBLE -
var dragging_enabled: bool = true -
var split_offset: int = 0 -
var vertical: bool = false -
func clamp_split_offset() -> void -
func get_drag_area_control() -> Control -
const DRAGGER_VISIBLE = 0 enum DraggerVisibility -
const DRAGGER_HIDDEN = 1 enum DraggerVisibility -
const DRAGGER_HIDDEN_COLLAPSED = 2 enum DraggerVisibility -
enum DraggerVisibility -
signal drag_ended() -
signal drag_started() -
signal dragged(offset: int) -
self["theme_override_constants/autohide"] = 1 as int -
self["theme_override_constants/minimum_grab_thickness"] = 6 as int -
self["theme_override_constants/separation"] = 12 as int -
self["theme_override_icons/grabber"] = icon as Texture2D -
self["theme_override_icons/h_grabber"] = icon as Texture2D -
self["theme_override_icons/v_grabber"] = icon as Texture2D -
self["theme_override_styles/split_bar_background"] = style as StyleBox
SplitContainer #
is_instantiable, Node, core, not_builtin_classes
A container that splits two child controls horizontally or vertically and provides a grabber for adjusting the split ratio.
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.
Members #
var collapsed: bool = false#
If true, the dragger will be disabled and the children will be sized as if the split_offset was 0.
var drag_area_highlight_in_editor: bool = false#
Highlights the drag area Rect2 so you can see where it is during development. The drag area is gold if dragging_enabled is true, and red if false.
var drag_area_margin_begin: int = 0#
Reduces the size of the drag area and split bar split_bar_background at the beginning of the container.
var drag_area_margin_end: int = 0#
Reduces the size of the drag area and split bar split_bar_background at the end of the container.
var drag_area_offset: int = 0#
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.
var dragger_visibility = DRAGGER_VISIBLE#
Determines the dragger's visibility. See DraggerVisibility for details. This property does not determine whether dragging is enabled or not. Use dragging_enabled for that.
var dragging_enabled: bool = true#
Enables or disables split dragging.
var split_offset: int = 0#
The initial offset of the splitting between the two Controls, with 0 being at the end of the first Control.
var vertical: bool = false#
If true, the SplitContainer will arrange its children vertically, rather than horizontally.
Can't be changed when using HSplitContainer and VSplitContainer.
Methods #
func clamp_split_offset() -> void#
Clamps the split_offset value to not go outside the currently possible minimal and maximum values.
func get_drag_area_control() -> Control#
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 Control.mouse_filter of custom children to Control.MOUSE_FILTER_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.
Annotations #
Constants #
const DRAGGER_VISIBLE = 0 enum DraggerVisibility#
The split dragger icon is always visible when autohide is false, otherwise visible only when the cursor hovers it.
The size of the grabber icon determines the minimum separation.
The dragger icon is automatically hidden if the length of the grabber icon is longer than the split bar.
const DRAGGER_HIDDEN = 1 enum DraggerVisibility#
The split dragger icon is never visible regardless of the value of autohide.
The size of the grabber icon determines the minimum separation.
const DRAGGER_HIDDEN_COLLAPSED = 2 enum DraggerVisibility#
The split dragger icon is not visible, and the split bar is collapsed to zero thickness.
Constructors #
Enums #
DraggerVisibility#
enum DraggerVisibility {
DRAGGER_VISIBLE = 0,
DRAGGER_HIDDEN = 1,
DRAGGER_HIDDEN_COLLAPSED = 2,
} Operators #
Signals #
signal drag_ended()#
Emitted when the user ends dragging.
signal drag_started()#
Emitted when the user starts dragging.
signal dragged(offset: int)#
Emitted when the dragger is dragged by user.
Theme Items #
self["theme_override_constants/autohide"] = 1 as int#
Boolean value. If 1 (true), the grabber will hide automatically when it isn't under the cursor. If 0 (false), it's always visible. The dragger_visibility must be DRAGGER_VISIBLE.
self["theme_override_constants/minimum_grab_thickness"] = 6 as int#
The minimum thickness of the area users can click on to grab the split bar. This ensures that the split bar can still be dragged if separation or h_grabber / v_grabber's size is too narrow to easily select.
self["theme_override_constants/separation"] = 12 as int#
The split bar thickness, i.e., the gap between the two children of the container. This is overridden by the size of the grabber icon if dragger_visibility is set to DRAGGER_VISIBLE, or DRAGGER_HIDDEN, and separation is smaller than the size of the grabber icon in the same axis.
Note: To obtain separation values less than the size of the grabber icon, for example a 1 px hairline, set h_grabber or v_grabber to a new ImageTexture, which effectively sets the grabber icon size to 0 px.
self["theme_override_icons/grabber"] = icon as Texture2D#
The icon used for the grabber drawn in the middle area.
self["theme_override_icons/h_grabber"] = icon as Texture2D#
The icon used for the grabber drawn in the middle area when vertical is false.
self["theme_override_icons/v_grabber"] = icon as Texture2D#
The icon used for the grabber drawn in the middle area when vertical is true.
self["theme_override_styles/split_bar_background"] = style as StyleBox#
Determines the background of the split bar if its thickness is greater than zero.