mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +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/master/doc/tools/make_rst.py.
|
||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SplitContainer.xml.
|
||
|
||
.. _class_SplitContainer:
|
||
|
||
SplitContainer
|
||
==============
|
||
|
||
**继承:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
**派生:** :ref:`HSplitContainer<class_HSplitContainer>`, :ref:`VSplitContainer<class_VSplitContainer>`
|
||
|
||
将两个子控件垂直或水平分隔的容器,提供了用于调整分隔比例的抓取器。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
仅接受两个子控件的容器,会将它们垂直或水平排列,在中间创建一个分隔条。分隔条可以拖拽,从而改变两个控件的大小关系。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教程
|
||
----
|
||
|
||
- :doc:`使用容器 <../tutorials/ui/gui_containers>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. 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
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+--------+---------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clamp_split_offset<class_SplitContainer_method_clamp_split_offset>`\ (\ ) |
|
||
+--------+---------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
主题属性
|
||
--------
|
||
|
||
.. 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
|
||
|
||
信号
|
||
----
|
||
|
||
.. _class_SplitContainer_signal_dragged:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**dragged**\ (\ offset\: :ref:`int<class_int>`\ ) :ref:`🔗<class_SplitContainer_signal_dragged>`
|
||
|
||
当用户拖动拖动器时发出。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
枚举
|
||
----
|
||
|
||
.. _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``
|
||
|
||
当光标悬停时,拆分拖动器是可见的。
|
||
|
||
.. _class_SplitContainer_constant_DRAGGER_HIDDEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_HIDDEN** = ``1``
|
||
|
||
拆分拖动器永远不可见。
|
||
|
||
.. _class_SplitContainer_constant_DRAGGER_HIDDEN_COLLAPSED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_HIDDEN_COLLAPSED** = ``2``
|
||
|
||
拆分拖动器永远不可见,其空间也被折叠。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _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**\ (\ )
|
||
|
||
如果为 ``true``\ ,第一个 :ref:`Control<class_Control>` 的区域将被折叠并且拖动器将被禁用。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
确定拖动器的可见性。有关详细信息,请参阅 :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>`\ 。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
两个 :ref:`Control<class_Control>` 之间拆分的初始偏移量,\ ``0`` 位于第一个 :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**\ (\ )
|
||
|
||
如果为 ``true``\ ,则该 **SplitContainer** 会垂直排列其子代,而不是水平排列。
|
||
|
||
在使用 :ref:`HSplitContainer<class_HSplitContainer>` 和 :ref:`VSplitContainer<class_VSplitContainer>` 时无法改变。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法说明
|
||
--------
|
||
|
||
.. _class_SplitContainer_method_clamp_split_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clamp_split_offset**\ (\ ) :ref:`🔗<class_SplitContainer_method_clamp_split_offset>`
|
||
|
||
限制 :ref:`split_offset<class_SplitContainer_property_split_offset>` 值不超出当前可能的最小值和最大值。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
主题属性说明
|
||
------------
|
||
|
||
.. _class_SplitContainer_theme_constant_autohide:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **autohide** = ``1`` :ref:`🔗<class_SplitContainer_theme_constant_autohide>`
|
||
|
||
布尔值。如果1 (``true``),抓取器将在不在光标下时自动隐藏。如果0 (``false``),抓取器总是可见。
|
||
|
||
.. 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>`
|
||
|
||
用户可以点击以抓取分割线的区域的最小厚度。如果 :ref:`separation<class_SplitContainer_theme_constant_separation>` 或 :ref:`h_grabber<class_SplitContainer_theme_icon_h_grabber>` / :ref:`v_grabber<class_SplitContainer_theme_icon_v_grabber>` 的厚度太小,这样可以确保拆分线仍然可以被拖动。
|
||
|
||
.. 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>`
|
||
|
||
容器两侧之间的空间。
|
||
|
||
.. 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>`
|
||
|
||
在中间区域绘制的抓取图标。
|
||
|
||
.. 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>`
|
||
|
||
:ref:`vertical<class_SplitContainer_property_vertical>` 为 ``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>`
|
||
|
||
:ref:`vertical<class_SplitContainer_property_vertical>` 为 ``true`` 时绘制在中间区域的抓取器图标。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||
.. |void| replace:: :abbr:`void (无返回值。)`
|