OnClientGUIScroll: Difference between revisions
Jump to navigation
Jump to search
(New page: {{Client event}} __NOTOC__ This event is fired when a GUI scrollbar is scrolled. ==Parameters== <syntaxhighlight lang="lua"> element Scrolled </syntaxhighlight> * '''Scrolled''': The scrollbar element that was ...) |
(Replace to predefined variables.) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
element | element scrolled | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* ''' | * '''scrolled''': the [[Element/GUI/Scrollbar|scrollbar]] element that was scrolled. | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the scrollbar element that | The [[event system#Event source|source]] of this event is the scrollbar element that got scrolled. | ||
==Example== | ==Example== | ||
This example outputs a message with the new scroll position when a scrollbar is scrolled. | This example outputs a message with the new scroll position when a scrollbar is scrolled. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function onClientGUIScroll(scrollBar) | ||
outputChatBox("The new scroll position is "..guiScrollBarGetScrollPosition( | outputChatBox("The new scroll position is "..guiScrollBarGetScrollPosition(scrollBar)) | ||
end | end | ||
addEventHandler("onClientGUIScroll", | addEventHandler("onClientGUIScroll", root, onClientGUIScroll) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[pl:onClientGUIScroll]] | |||
==See Also== | ==See Also== | ||
{{GUI_events}} | {{GUI_events}} | ||
===Client event functions=== | ===Client event functions=== | ||
{{Client_event_functions}} | {{Client_event_functions}} |
Latest revision as of 07:11, 13 July 2023
This event is fired when a GUI scrollbar is scrolled.
Parameters
element scrolled
- scrolled: the scrollbar element that was scrolled.
Source
The source of this event is the scrollbar element that got scrolled.
Example
This example outputs a message with the new scroll position when a scrollbar is scrolled.
function onClientGUIScroll(scrollBar) outputChatBox("The new scroll position is "..guiScrollBarGetScrollPosition(scrollBar)) end addEventHandler("onClientGUIScroll", root, onClientGUIScroll)
See Also
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled