guiScrollPaneGetVerticalScrollPosition | Multi Theft Auto: Wiki Skip to content

guiScrollPaneGetVerticalScrollPosition

Client-side
Server-side
Shared

Pair: guiScrollPaneSetVerticalScrollPosition

This function is used to get the position of a vertical scroll pane as a percentage.

OOP Syntax Help! I don't understand this!

  • Method:gui-scrollpane:getVerticalScrollPosition(...)
  • Variable: .verticalScrollPosition

Syntax

float|false guiScrollPaneGetVerticalScrollPosition ( ​gui-scrollpane verticalScrollPane )
Required arguments
  • verticalScrollPane: The scroll pane you want to know the position of.

Returns

Returns a float ranging between 0 and 100, or false otherwise.

  • float|false: Vertical scroll position

Code Examples

client
local scrollpane = guiCreateScrollPane(0.3, 0.3, 0.2, 0.2, true)
local label = guiCreateLabel(0.3, 0.28, 0.1, 0.1, 'Vertical scroll: 0%', true, window)
for i = 1,10 do
guiCreateButton(0.1, 0.4 + 0.25 * i, 0.2, 0.2, 'Button '..i, true, scrollpane)
end
setTimer(function()
guiSetText(label, 'Vertical scroll: '..math.floor(guiScrollPaneGetVerticalScrollPosition(scrollpane))..'%')
end, 250, 0)

See Also

GUI Functions