guiScrollPaneSetVerticalScrollPosition | Multi Theft Auto: Wiki Skip to content

guiScrollPaneSetVerticalScrollPosition

Client-side
Server-side
Shared

Pair: guiScrollPaneGetVerticalScrollPosition

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

OOP Syntax Help! I don't understand this!

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

Syntax

bool guiScrollPaneSetVerticalScrollPosition ( ​gui-scrollpane verticalScrollPane, ​float position )
Required arguments
  • verticalScrollPane: The scroll pane you want to change the position of.
  • position: A float ranging from 0 - 100.

Returns

Returns true if the position was set, false otherwise.

  • bool: result

Code Examples

client
local scrollpane = guiCreateScrollPane(0.3, 0.3, 0.2, 0.2, true)
for i = 1,10 do
guiCreateButton(0.1, 0.4 + 0.25 * i, 0.2, 0.2, 'Button '..i, true, scrollpane)
end
addCommandHandler('scroll', function(cmd, value)
if (not tonumber(value)) then
return
end
guiScrollPaneSetVerticalScrollPosition(scrollpane, tonumber(value))
end)

See Also

GUI Functions