- Documentation
- Client functions
- guiCreateScrollBar
Function
guiCreateScrollBar
Creates a scroll bar (0-100). Moving it fires onClientGUIScroll.
Syntax
gui-scrollbar guiCreateScrollBar(float x, float y, float width, float height, bool horizontal, bool relative [, element parent = nil])Arguments
xfloat- X position.
yfloat- Y position.
widthfloat- Width.
heightfloat- Height.
horizontalbooltruefor horizontal.relativebool- Relative values.Optional in MTA:SA: bool relative = false
parentelement, optional = nil- Parent.
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
guiCreateScrollBar(float x, float y, float width, float height, bool horizontal, bool relative = false, gui-element parent = nil)Returns
The scroll bar.
Example
local bar = guiCreateScrollBar(20, 20, 300, 20, true, false)
addEventHandler("onClientGUIScroll", bar, function()
outputChatBox("Pozycja: " .. guiScrollBarGetScrollPosition(bar))
end, false)