ScrollContainer

Inherits: Container < Control < CanvasItem < Node < Object

Inherited By: EditorInspector

Category: Core

Brief Description

A helper node for displaying scrollable elements (e.g. lists).

Properties

intscroll_deadzone
intscroll_horizontal
boolscroll_horizontal_enabled
intscroll_vertical
boolscroll_vertical_enabled

Methods

HScrollBarget_h_scrollbar ( )
VScrollBarget_v_scrollbar ( )

Theme Properties

StyleBoxbg

Signals

  • scroll_ended ( )

Emitted whenever scrolling stops.


  • scroll_started ( )

Emitted whenever scrolling is started.

Description

A ScrollContainer node meant to contain a Control child. ScrollContainers will automatically create a scrollbar child (HScrollBar, 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 minimum_size of the Control relative to the ScrollContainer. Works great with a Panel control. You can set EXPAND on children size flags, so they will upscale to ScrollContainer size if ScrollContainer size is bigger (scroll is invisible for chosen dimension).

Property Descriptions

  • int scroll_deadzone
Setterset_deadzone(value)
Getterget_deadzone()

  • int scroll_horizontal
Setterset_h_scroll(value)
Getterget_h_scroll()

The current horizontal scroll value.


  • bool scroll_horizontal_enabled
Setterset_enable_h_scroll(value)
Getteris_h_scroll_enabled()

If true, enables horizontal scrolling.


  • int scroll_vertical
Setterset_v_scroll(value)
Getterget_v_scroll()

The current vertical scroll value.


  • bool scroll_vertical_enabled
Setterset_enable_v_scroll(value)
Getteris_v_scroll_enabled()

If true, enables vertical scrolling.

Method Descriptions