ScrollContainer
A container used to provide scrollbars to a child control when needed.
ScrollContainer.swift:23class ScrollContainer
A container used to provide a child control with scrollbars when needed. 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 customMinimumSize
of the Control relative to the ScrollContainer.
This object emits the following signals:
Superclasses
class Container
Base class for all GUI containers.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
var followFocus: Bool
If
true
, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible.var horizontalScrollMode: ScrollContainer.ScrollMode
Controls whether horizontal scrollbar can be used and when it should be visible. See
ScrollMode
for options.var scrollDeadzone: Int32
Deadzone for touch scrolling. Lower deadzone makes the scrolling more sensitive.
var scrollEnded: SimpleSignal
Emitted when scrolling stops when dragging the scrollable area with a touch event. This signal is not emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
var scrollHorizontal: Int32
The current horizontal scroll value.
var scrollHorizontalCustomStep: Double
Overrides the
customStep
used when clicking the internal scroll bar’s horizontal increment and decrement buttons or when using arrow keys when theScrollBar
is focused.var scrollStarted: SimpleSignal
Emitted when scrolling starts when dragging the scrollable area w_ith a touch event_. This signal is not emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
var scrollVertical: Int32
The current vertical scroll value.
var scrollVerticalCustomStep: Double
Overrides the
customStep
used when clicking the internal scroll bar’s vertical increment and decrement buttons or when using arrow keys when theScrollBar
is focused.var verticalScrollMode: ScrollContainer.ScrollMode
Controls whether vertical scrollbar can be used and when it should be visible. See
ScrollMode
for options.func ensureControlVisible(control: Control?
) Ensures the given
control
is visible (must be a direct or indirect child of the ScrollContainer). Used byfollowFocus
.func getHScrollBar(
) -> HScrollBar? Returns the horizontal scrollbar
HScrollBar
of thisScrollContainer
.func getVScrollBar(
) -> VScrollBar? Returns the vertical scrollbar
VScrollBar
of thisScrollContainer
.
Subclasses
class EditorInspector
A control used to edit properties of an object.