class UIScrollViewer
A scrollable ui-block.
class UIScrollViewer extends UIBlock
Inheritance UIElement –> UIBlock –> UIScrollViewer
Name | Description |
---|---|
Constructors | |
UIScrollViewer() | Creates a new UIScrollViewer. |
Properties | |
scrollableVertical | Indicates whether the ui-scrollviewer is vertical-scrollable. |
scrollableHorizontal | Indicates whether the ui-scrollviewer is horizontal-scrollable. |
scrollPosition | Current scroll position. |
contentSize | Content size. |
Methods | |
setStyle() | Set the displaying style of the ui-scrollviewer. |
getScrollPosition() | Get the value of .scrollPosition |
setScrollPosition() | Set the value of .scrollPosition |
getContentSize() | Get the value of .contentSize |
setContentSize() | Set the value of .contentSize |
Constructors
UIScrollViewer()
UIScrollViewer
()
Creates a new UIScrollViewer.
Properties
See the base UIBlock class for common properties.
scrollableVertical
.scrollableVertical
: Boolean
Indicates whether the ui-scrollviewer is vertical-scrollable.
Readble and writable.
Default is true.
scrollableHorizontal
.scrollableHorizontal
: Boolean
Indicates whether the ui-scrollviewer is horizontal-scrollable.
Readble and writable.
Default is false.
scrollPosition
.scrollPosition
: Object
A Vector2 representing the ui-scrollviewer’s current scroll position.
Read-only. Use method setScrollPosition()
to modify this property.
Default is {x: 0, y: 0}.
contentSize
.contentSize
: Object
A Vector2 representing the ui-scrollviewer’s content size.
Read-only. Use method setContentSize()
to modify this property.
Default is {x: 100, y: 100}.
Methods
See the base UIBlock class for common methods.
setStyle()
.setStyle
(style
: Object): undefined
Set the displaying style of the ui-panel.
style
may have the following properties:
style.cornerRadius
: Number
Corner radius of the rounded rectangle.
style.strokeWidth
: Number
Line-width of the stroke.
style.colorBg
: String
Background color of the panel.
style.colorStroke
: String
Stroke color of the panel.
getScrollPosition()
.getScrollPosition
(vector
: Vector2): Vector2
Copy the value of .scrollPosition
into vector
.
setScrollPosition()
.setScrollPosition
(vector
: Vector2): undefined
Set the value of .scrollPosition
according to vector
.
.setScrollPosition
(x
: Number, y
: Number): undefined
Set the value of .scrollPosition
according to the x, y coordinates.
getContentSize()
.getContentSize
(vector
: Vector2): Vector2
Copy the value of .contentSize
into vector
.
setContentSize()
.setContentSize
(vector
: Vector2): undefined
Set the value of .contentSize
according to vector
.
.setContentSize
(x
: Number, y
: Number): undefined
Set the value of .contentSize
according to the x, y coordinates.