Doc - gui - ScrollField


Class: ScrollField

Inherits from: UiElement

Scrollable sub-window element

Constructor

pos.gui.ScrollField(x: number, y: number, w: number, h: number)

Creates a new scrollable field with given width and height

Variables

Type Name Description
number scroll Current scroll value
string type Override. type is 'ScrollField'

Private Variables

Type Name Description
string _elements Sub UiElements drawn within the scroll field
table __elementIndex Index of last added sub-element

Instance Functions

Return Name Description
nil draw(window: Window) Override. Draws the scroll field and sub-elements
nil process(event: table, window: Window) Override. Processes mouse_scroll events
number addElement(element: UiElement) Add a sub-element to the field, returning element index
nil removeElement(index: number) Remove a sub-element by index