Ui XML Scroll - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Ui XML Reference\Scroll](#ui-xml-referencescroll)
* [inertia](#inertia)
* [decelerationRate](#decelerationrate)
* [contentAlignment](#contentalignment)
|
Ui XML Reference\Scroll
A 2D scrollable frame. By default, this frame type attempts to fill its parent size unless given explicit dimensions.
<Scroll height="500" width="500">
<Frame width="1000" height="1000" backgroundImageColor="r: 1, g: 1, b: 1, a: 0.8" />
<Text text="Left" leftAlignmentInParent="true" />
<Text text="Right" rightAlignmentInParent="true" />
<Text text="Top" topAlignmentInParent="true" />
<Text text="Bottom" bottomAlignmentInParent="true" />
<Text text="Center" />
</Scroll>
This xml script produces the following UI:
A scrollable frame that be scrolled both vertically and horizontally
Value type: boolean
Supports data binding
The inertia status of the Scroll frame, where true
is enabled and false
is disabled. Inertia is set to true
by default. Inertia causes the scroll frame's scrolling to slow by the given deceleration rate, to a stop, after the mouse is released. If inertia is disabled the frame does not continue scrolling after the mouse is released.
<Scroll height="500" width="500" inertia = "false">
<Frame width="1000" height="1000" backgroundImageColor="r: 1, g: 1, b: 1, a: 0.8" />
<Text text="Left" leftAlignmentInParent="true" />
<Text text="Right" rightAlignmentInParent="true" />
<Text text="Top" topAlignmentInParent="true" />
<Text text="Bottom" bottomAlignmentInParent="true" />
<Text text="Center" />
</Scroll>
Value type: number
Supports data binding
The deceleration rate for the inertia, if enabled. A value of 0 will cause instant deceleration (equivalent to setting the inertia to false). Values between 0 and 1 will cause deceleration. A value of 1 will cause no deceleration. A value greater than 1 will cause acceleration. A negative value will break the scroll element.
<Scroll height="500" width="500" decelerationRate="0.5">
<Frame width="1000" height="1000" backgroundImageColor="r: 1, g: 1, b: 1, a: 0.8" />
<Text text="Left" leftAlignmentInParent="true" />
<Text text="Right" rightAlignmentInParent="true" />
<Text text="Top" topAlignmentInParent="true" />
<Text text="Bottom" bottomAlignmentInParent="true" />
<Text text="Center" />
</Scroll>
Related Trigger Function(s):
Value type: string
Supports data binding
The content alignment of the Scroll frame.This value determines where the initial display location of the scroll content is. Options are left
, right
, top
, bottom
, and (top|bottom)-(left|right)
. The default alignment is top-left
<Scroll height="500" width="500" contentAlignment="bottom-right">
<Frame width="1000" height="1000" backgroundImageColor="r: 1, g: 1, b: 1, a: 0.8" />
<Text text="Left" leftAlignmentInParent="true" />
<Text text="Right" rightAlignmentInParent="true" />
<Text text="Top" topAlignmentInParent="true" />
<Text text="Bottom" bottomAlignmentInParent="true" />
<Text text="Center" />
</Scroll>