:github_url: hide .. Generated automatically by doc/tools/make_rst.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//doc_classes. .. _class_ScrollContainer: ScrollContainer =============== **Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`EditorInspector` A helper node for displaying scrollable elements such as lists. Description ----------- A ScrollContainer node meant to contain a :ref:`Control` child. ScrollContainers will automatically create a scrollbar child (:ref:`HScrollBar`, :ref:`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` of the Control relative to the ScrollContainer. Works great with a :ref:`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` | :ref:`follow_focus` | ``false`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`bool` | rect_clip_content | ``true`` *(parent override)* | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`int` | :ref:`scroll_deadzone` | ``0`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`int` | :ref:`scroll_horizontal` | ``0`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`scroll_horizontal_enabled` | ``true`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`scroll_horizontal_visible` | ``true`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`int` | :ref:`scroll_vertical` | ``0`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`scroll_vertical_enabled` | ``true`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`scroll_vertical_visible` | ``true`` | +-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ Methods ------- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`ensure_control_visible` **(** :ref:`Control` control **)** | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`HScrollBar` | :ref:`get_h_scrollbar` **(** **)** | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`VScrollBar` | :ref:`get_v_scrollbar` **(** **)** | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ Theme Properties ---------------- +---------------------------------+-------------------------------------------------+ | :ref:`StyleBox` | :ref:`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` **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` **scroll_deadzone** +-----------+---------------------+ | *Default* | ``0`` | +-----------+---------------------+ | *Setter* | set_deadzone(value) | +-----------+---------------------+ | *Getter* | get_deadzone() | +-----------+---------------------+ ---- .. _class_ScrollContainer_property_scroll_horizontal: - :ref:`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` **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_horizontal_visible: - :ref:`bool` **scroll_horizontal_visible** +-----------+-----------------------------+ | *Default* | ``true`` | +-----------+-----------------------------+ | *Setter* | set_h_scroll_visible(value) | +-----------+-----------------------------+ | *Getter* | is_h_scroll_visible() | +-----------+-----------------------------+ If ``false``, hides the horizontal scrollbar. ---- .. _class_ScrollContainer_property_scroll_vertical: - :ref:`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` **scroll_vertical_enabled** +-----------+----------------------------+ | *Default* | ``true`` | +-----------+----------------------------+ | *Setter* | set_enable_v_scroll(value) | +-----------+----------------------------+ | *Getter* | is_v_scroll_enabled() | +-----------+----------------------------+ If ``true``, enables vertical scrolling. ---- .. _class_ScrollContainer_property_scroll_vertical_visible: - :ref:`bool` **scroll_vertical_visible** +-----------+-----------------------------+ | *Default* | ``true`` | +-----------+-----------------------------+ | *Setter* | set_v_scroll_visible(value) | +-----------+-----------------------------+ | *Getter* | is_v_scroll_visible() | +-----------+-----------------------------+ If ``false``, hides the vertical scrollbar. Method Descriptions ------------------- .. _class_ScrollContainer_method_ensure_control_visible: - void **ensure_control_visible** **(** :ref:`Control` control **)** Ensures the given ``control`` is visible (must be a direct or indirect child of the ScrollContainer). Used by :ref:`follow_focus`. ---- .. _class_ScrollContainer_method_get_h_scrollbar: - :ref:`HScrollBar` **get_h_scrollbar** **(** **)** Returns the horizontal scrollbar :ref:`HScrollBar` of this ``ScrollContainer``. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the horizontal scrollbar, use :ref:`scroll_horizontal_enabled`. If you want to only hide it instead, use :ref:`scroll_horizontal_visible`. ---- .. _class_ScrollContainer_method_get_v_scrollbar: - :ref:`VScrollBar` **get_v_scrollbar** **(** **)** Returns the vertical scrollbar :ref:`VScrollBar` of this ``ScrollContainer``. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the vertical scrollbar, use :ref:`scroll_vertical_enabled`. If you want to only hide it instead, use :ref:`scroll_vertical_visible`. Theme Property Descriptions --------------------------- .. _class_ScrollContainer_theme_style_bg: - :ref:`StyleBox` **bg** The background :ref:`StyleBox` of the ``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.)` .. |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.)`