GuiScrollBarGetScrollPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: {{client function}} This function gets the scroll amount of a scrollbar as a percentage. ==Syntax== <syntaxhighlight lang="lua"> float guiScrollBarGetScrollPosition ( gui-scrollBar theScrollBar ) </code...)
 
 
(2 intermediate revisions by 2 users not shown)
Line 14: Line 14:


==Example==
==Example==
This page lacks an example
This example outputs a message with the new scroll position when a scrollbar is scrolled.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--add an example here
function OnScroll( )
outputChatBox( "The new scroll position is " .. guiScrollBarGetScrollPosition( source ) )
end
addEventHandler( "onClientGUIScroll", root, OnScroll )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
{{GUI_events}}
[[Catogory:Needs_Example]]
[[Catogory:Needs_Example]]

Latest revision as of 14:18, 20 May 2018

This function gets the scroll amount of a scrollbar as a percentage.

Syntax

float guiScrollBarGetScrollPosition ( gui-scrollBar theScrollBar )

Required Arguments

  • theScrollBar : The scrollbar you want to check.

Returns

Returns a float ranging between 0 and 100, representing the amount the scrollbar has been scrolled.

Example

This example outputs a message with the new scroll position when a scrollbar is scrolled.

function OnScroll( )
	outputChatBox( "The new scroll position is " .. guiScrollBarGetScrollPosition( source ) )
end
addEventHandler( "onClientGUIScroll", root, OnScroll )

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI


Catogory:Needs_Example