mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
318 lines
12 KiB
ReStructuredText
318 lines
12 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/4.3/doc/classes/SplitContainer.xml.
|
|
|
|
.. _class_SplitContainer:
|
|
|
|
SplitContainer
|
|
==============
|
|
|
|
**Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Inherited By:** :ref:`HSplitContainer<class_HSplitContainer>`, :ref:`VSplitContainer<class_VSplitContainer>`
|
|
|
|
A container that splits two child controls horizontally or vertically and provides a grabber for adjusting the split ratio.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Description
|
|
-----------
|
|
|
|
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.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutorials
|
|
---------
|
|
|
|
- :doc:`Using Containers <../tutorials/ui/gui_containers>`
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Properties
|
|
----------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`collapsed<class_SplitContainer_property_collapsed>` | ``false`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
|
| :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` | :ref:`dragger_visibility<class_SplitContainer_property_dragger_visibility>` | ``0`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
|
| :ref:`int<class_int>` | :ref:`split_offset<class_SplitContainer_property_split_offset>` | ``0`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`vertical<class_SplitContainer_property_vertical>` | ``false`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Methods
|
|
-------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------+---------------------------------------------------------------------------------+
|
|
| |void| | :ref:`clamp_split_offset<class_SplitContainer_method_clamp_split_offset>`\ (\ ) |
|
|
+--------+---------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Theme Properties
|
|
----------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------------+-------------------------------------------------------------------------------------------+--------+
|
|
| :ref:`int<class_int>` | :ref:`autohide<class_SplitContainer_theme_constant_autohide>` | ``1`` |
|
|
+-----------------------------------+-------------------------------------------------------------------------------------------+--------+
|
|
| :ref:`int<class_int>` | :ref:`minimum_grab_thickness<class_SplitContainer_theme_constant_minimum_grab_thickness>` | ``6`` |
|
|
+-----------------------------------+-------------------------------------------------------------------------------------------+--------+
|
|
| :ref:`int<class_int>` | :ref:`separation<class_SplitContainer_theme_constant_separation>` | ``12`` |
|
|
+-----------------------------------+-------------------------------------------------------------------------------------------+--------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`grabber<class_SplitContainer_theme_icon_grabber>` | |
|
|
+-----------------------------------+-------------------------------------------------------------------------------------------+--------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`h_grabber<class_SplitContainer_theme_icon_h_grabber>` | |
|
|
+-----------------------------------+-------------------------------------------------------------------------------------------+--------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`v_grabber<class_SplitContainer_theme_icon_v_grabber>` | |
|
|
+-----------------------------------+-------------------------------------------------------------------------------------------+--------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_SplitContainer_signal_dragged:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**dragged**\ (\ offset\: :ref:`int<class_int>`\ ) :ref:`🔗<class_SplitContainer_signal_dragged>`
|
|
|
|
Emitted when the dragger is dragged by user.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Enumerations
|
|
------------
|
|
|
|
.. _enum_SplitContainer_DraggerVisibility:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **DraggerVisibility**: :ref:`🔗<enum_SplitContainer_DraggerVisibility>`
|
|
|
|
.. _class_SplitContainer_constant_DRAGGER_VISIBLE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_VISIBLE** = ``0``
|
|
|
|
The split dragger is visible when the cursor hovers it.
|
|
|
|
.. _class_SplitContainer_constant_DRAGGER_HIDDEN:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_HIDDEN** = ``1``
|
|
|
|
The split dragger is never visible.
|
|
|
|
.. _class_SplitContainer_constant_DRAGGER_HIDDEN_COLLAPSED:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_HIDDEN_COLLAPSED** = ``2``
|
|
|
|
The split dragger is never visible and its space collapsed.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_SplitContainer_property_collapsed:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **collapsed** = ``false`` :ref:`🔗<class_SplitContainer_property_collapsed>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_collapsed**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_collapsed**\ (\ )
|
|
|
|
If ``true``, the area of the first :ref:`Control<class_Control>` will be collapsed and the dragger will be disabled.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_property_dragger_visibility:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **dragger_visibility** = ``0`` :ref:`🔗<class_SplitContainer_property_dragger_visibility>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_dragger_visibility**\ (\ value\: :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>`\ )
|
|
- :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **get_dragger_visibility**\ (\ )
|
|
|
|
Determines the dragger's visibility. See :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` for details.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_property_split_offset:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **split_offset** = ``0`` :ref:`🔗<class_SplitContainer_property_split_offset>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_split_offset**\ (\ value\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_split_offset**\ (\ )
|
|
|
|
The initial offset of the splitting between the two :ref:`Control<class_Control>`\ s, with ``0`` being at the end of the first :ref:`Control<class_Control>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_property_vertical:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **vertical** = ``false`` :ref:`🔗<class_SplitContainer_property_vertical>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_vertical**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_vertical**\ (\ )
|
|
|
|
If ``true``, the **SplitContainer** will arrange its children vertically, rather than horizontally.
|
|
|
|
Can't be changed when using :ref:`HSplitContainer<class_HSplitContainer>` and :ref:`VSplitContainer<class_VSplitContainer>`.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_SplitContainer_method_clamp_split_offset:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **clamp_split_offset**\ (\ ) :ref:`🔗<class_SplitContainer_method_clamp_split_offset>`
|
|
|
|
Clamps the :ref:`split_offset<class_SplitContainer_property_split_offset>` value to not go outside the currently possible minimal and maximum values.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Theme Property Descriptions
|
|
---------------------------
|
|
|
|
.. _class_SplitContainer_theme_constant_autohide:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **autohide** = ``1`` :ref:`🔗<class_SplitContainer_theme_constant_autohide>`
|
|
|
|
Boolean value. If 1 (``true``), the grabber will hide automatically when it isn't under the cursor. If 0 (``false``), it's always visible.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_theme_constant_minimum_grab_thickness:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **minimum_grab_thickness** = ``6`` :ref:`🔗<class_SplitContainer_theme_constant_minimum_grab_thickness>`
|
|
|
|
The minimum thickness of the area users can click on to grab the splitting line. If :ref:`separation<class_SplitContainer_theme_constant_separation>` or :ref:`h_grabber<class_SplitContainer_theme_icon_h_grabber>` / :ref:`v_grabber<class_SplitContainer_theme_icon_v_grabber>`'s thickness are too small, this ensure that the splitting line can still be dragged.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_theme_constant_separation:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **separation** = ``12`` :ref:`🔗<class_SplitContainer_theme_constant_separation>`
|
|
|
|
The space between sides of the container.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_theme_icon_grabber:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`Texture2D<class_Texture2D>` **grabber** :ref:`🔗<class_SplitContainer_theme_icon_grabber>`
|
|
|
|
The icon used for the grabber drawn in the middle area.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_theme_icon_h_grabber:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`Texture2D<class_Texture2D>` **h_grabber** :ref:`🔗<class_SplitContainer_theme_icon_h_grabber>`
|
|
|
|
The icon used for the grabber drawn in the middle area when :ref:`vertical<class_SplitContainer_property_vertical>` is ``false``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SplitContainer_theme_icon_v_grabber:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`Texture2D<class_Texture2D>` **v_grabber** :ref:`🔗<class_SplitContainer_theme_icon_v_grabber>`
|
|
|
|
The icon used for the grabber drawn in the middle area when :ref:`vertical<class_SplitContainer_property_vertical>` is ``true``.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|
|
.. |void| replace:: :abbr:`void (No return value.)`
|