guiScrollPaneGetHorizontalScrollPosition | Multi Theft Auto: Wiki Skip to content

guiScrollPaneGetHorizontalScrollPosition

Client-side
Server-side
Shared

Manual Review Required

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


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

Syntax

float guiScrollPaneGetHorizontalScrollPosition ( element horizontalScrollPane )
Required Arguments
  • horizontalScrollPane: The scroll pane you want to know the position of

Returns

  • float: value

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

Code Examples

shared

This example gets the position of a scroll pane called "myScrollPane" created withguiCreateScrollPane, and outputs it to the chatbox.

if ( myScrollPane ) then -- if the scroll pane exist then
-- get the position
local position = guiScrollPaneGetHorizontalScrollPosition( myScrollPane )
-- output to the chatbox
outputChatBox ( "Current position of scroll pane:" .. tostring(position) .. "%" )
else -- if the scroll pane was not found
outputChatBox ("scroll pane not found!")
end

See Also

GUI Functions