123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- :github_url: hide
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the ScrollContainer.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_ScrollContainer:
- ScrollContainer
- ===============
- **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`EditorInspector<class_EditorInspector>`
- A helper node for displaying scrollable elements such as lists.
- Description
- -----------
- A ScrollContainer node meant to contain a :ref:`Control<class_Control>` child. ScrollContainers will automatically create a scrollbar child (:ref:`HScrollBar<class_HScrollBar>`, :ref:`VScrollBar<class_VScrollBar>`, or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the :ref:`Control.rect_min_size<class_Control_property_rect_min_size>` of the Control relative to the ScrollContainer. Works great with a :ref:`Panel<class_Panel>` control. You can set ``EXPAND`` on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension).
- Properties
- ----------
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- | :ref:`bool<class_bool>` | :ref:`follow_focus<class_ScrollContainer_property_follow_focus>` | ``false`` |
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- | :ref:`bool<class_bool>` | rect_clip_content | ``true`` *(parent override)* |
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- | :ref:`int<class_int>` | :ref:`scroll_deadzone<class_ScrollContainer_property_scroll_deadzone>` | ``0`` |
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- | :ref:`int<class_int>` | :ref:`scroll_horizontal<class_ScrollContainer_property_scroll_horizontal>` | ``0`` |
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- | :ref:`bool<class_bool>` | :ref:`scroll_horizontal_enabled<class_ScrollContainer_property_scroll_horizontal_enabled>` | ``true`` |
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- | :ref:`int<class_int>` | :ref:`scroll_vertical<class_ScrollContainer_property_scroll_vertical>` | ``0`` |
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- | :ref:`bool<class_bool>` | :ref:`scroll_vertical_enabled<class_ScrollContainer_property_scroll_vertical_enabled>` | ``true`` |
- +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+
- Methods
- -------
- +-------------------------------------+----------------------------------------------------------------------------------+
- | :ref:`HScrollBar<class_HScrollBar>` | :ref:`get_h_scrollbar<class_ScrollContainer_method_get_h_scrollbar>` **(** **)** |
- +-------------------------------------+----------------------------------------------------------------------------------+
- | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scrollbar<class_ScrollContainer_method_get_v_scrollbar>` **(** **)** |
- +-------------------------------------+----------------------------------------------------------------------------------+
- Theme Properties
- ----------------
- +---------------------------------+----+
- | :ref:`StyleBox<class_StyleBox>` | bg |
- +---------------------------------+----+
- Signals
- -------
- .. _class_ScrollContainer_signal_scroll_ended:
- - **scroll_ended** **(** **)**
- Emitted when scrolling stops.
- ----
- .. _class_ScrollContainer_signal_scroll_started:
- - **scroll_started** **(** **)**
- Emitted when scrolling is started.
- Property Descriptions
- ---------------------
- .. _class_ScrollContainer_property_follow_focus:
- - :ref:`bool<class_bool>` **follow_focus**
- +-----------+-------------------------+
- | *Default* | ``false`` |
- +-----------+-------------------------+
- | *Setter* | set_follow_focus(value) |
- +-----------+-------------------------+
- | *Getter* | is_following_focus() |
- +-----------+-------------------------+
- If ``true``, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible.
- ----
- .. _class_ScrollContainer_property_scroll_deadzone:
- - :ref:`int<class_int>` **scroll_deadzone**
- +-----------+---------------------+
- | *Default* | ``0`` |
- +-----------+---------------------+
- | *Setter* | set_deadzone(value) |
- +-----------+---------------------+
- | *Getter* | get_deadzone() |
- +-----------+---------------------+
- ----
- .. _class_ScrollContainer_property_scroll_horizontal:
- - :ref:`int<class_int>` **scroll_horizontal**
- +-----------+---------------------+
- | *Default* | ``0`` |
- +-----------+---------------------+
- | *Setter* | set_h_scroll(value) |
- +-----------+---------------------+
- | *Getter* | get_h_scroll() |
- +-----------+---------------------+
- The current horizontal scroll value.
- ----
- .. _class_ScrollContainer_property_scroll_horizontal_enabled:
- - :ref:`bool<class_bool>` **scroll_horizontal_enabled**
- +-----------+----------------------------+
- | *Default* | ``true`` |
- +-----------+----------------------------+
- | *Setter* | set_enable_h_scroll(value) |
- +-----------+----------------------------+
- | *Getter* | is_h_scroll_enabled() |
- +-----------+----------------------------+
- If ``true``, enables horizontal scrolling.
- ----
- .. _class_ScrollContainer_property_scroll_vertical:
- - :ref:`int<class_int>` **scroll_vertical**
- +-----------+---------------------+
- | *Default* | ``0`` |
- +-----------+---------------------+
- | *Setter* | set_v_scroll(value) |
- +-----------+---------------------+
- | *Getter* | get_v_scroll() |
- +-----------+---------------------+
- The current vertical scroll value.
- ----
- .. _class_ScrollContainer_property_scroll_vertical_enabled:
- - :ref:`bool<class_bool>` **scroll_vertical_enabled**
- +-----------+----------------------------+
- | *Default* | ``true`` |
- +-----------+----------------------------+
- | *Setter* | set_enable_v_scroll(value) |
- +-----------+----------------------------+
- | *Getter* | is_v_scroll_enabled() |
- +-----------+----------------------------+
- If ``true``, enables vertical scrolling.
- Method Descriptions
- -------------------
- .. _class_ScrollContainer_method_get_h_scrollbar:
- - :ref:`HScrollBar<class_HScrollBar>` **get_h_scrollbar** **(** **)**
- Returns the horizontal scrollbar :ref:`HScrollBar<class_HScrollBar>` of this ``ScrollContainer``.
- ----
- .. _class_ScrollContainer_method_get_v_scrollbar:
- - :ref:`VScrollBar<class_VScrollBar>` **get_v_scrollbar** **(** **)**
- Returns the vertical scrollbar :ref:`VScrollBar<class_VScrollBar>` of this ``ScrollContainer``.
- .. |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.)`
|