guiScrollBarSetScrollPosition | Multi Theft Auto: Wiki Skip to content

guiScrollBarSetScrollPosition

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is used to set the scroll amount of a scrollbar as a percentage.

Syntax

guiScrollBarSetScrollPosition ( )

Code Examples

client

In this example, you can set the scrolling position using the command /pos

local window = guiCreateWindow(0.3,0.3,0.3,0.3,"Scroll-Position",true)
local scroll_bar = guiCreateScrollBar(5,25,30,245,false,false,window)
function scroll_bar_setPos(_,position)
if (tonumber(position)) then -- If we have typed a position
guiScrollBarSetScrollPosition(scroll_bar,position) --Set the position in the scroll bar
end
end
addCommandHandler("pos",scroll_bar_setPos)

See Also

GUI Functions