GuiScrollBarSetScrollPosition: Difference between revisions
Jump to navigation
Jump to search
(New page: {{client function}} This function is used to set the scroll amount of a scrollbar as a percentage. ==Syntax== <syntaxhighlight lang="lua"> bool guiScrollBarSetPosition ( gui-scrollBar theScrollBar, floa...) |
No edit summary |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool guiScrollBarSetScrollPosition ( gui-scrollBar theScrollBar, float amount ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
In this example, you can set the scrolling position using the command /pos <amount> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | 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) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{GUI_functions}} | {{GUI_functions}} | ||
{{GUI_events}} |
Latest revision as of 12:41, 20 September 2021
This function is used to set the scroll amount of a scrollbar as a percentage.
Syntax
bool guiScrollBarSetScrollPosition ( gui-scrollBar theScrollBar, float amount )
Required Arguments
- theScrollBar: The scrollbar you want to change the progress of
- amount: a float ranging from 0 - 100 representing the amount you wish to set the scroll bar.
Returns
Returns true if the scroll position was successfully set, false otherwise.
Example
In this example, you can set the scrolling position using the command /pos <amount>
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
General functions
- guiBringToFront
- getChatboxLayout
- getChatboxCharacterLimit
- guiCreateFont
- guiBlur
- guiFocus
- guiGetAlpha
- guiGetCursorType
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSize
- guiGetText
- guiGetVisible
- guiMoveToBack
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSize
- guiSetText
- guiSetVisible
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
- setChatboxCharacterLimit
- setDebugViewActive
Browsers
Buttons
Checkboxes
Comboboxes
- guiCreateComboBox
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemCount
- guiComboBoxGetItemText
- guiComboBoxGetSelected
- guiComboBoxIsOpen
- guiComboBoxRemoveItem
- guiComboBoxSetItemText
- guiComboBoxSetOpen
- guiComboBoxSetSelected
Edit Boxes
- guiCreateEdit
- guiEditGetCaretIndex
- guiEditGetMaxLength
- guiEditIsMasked
- guiEditIsReadOnly
- guiEditSetCaretIndex
- guiEditSetMasked
- guiEditSetMaxLength
- guiEditSetReadOnly
Gridlists
- guiCreateGridList
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetColumnCount
- guiGridListGetColumnTitle
- guiGridListGetColumnWidth
- guiGridListGetHorizontalScrollPosition
- guiGridListGetItemColor
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedCount
- guiGridListGetSelectedItem
- guiGridListGetSelectedItems
- guiGridListGetSelectionMode
- guiGridListIsSortingEnabled
- guiGridListGetVerticalScrollPosition
- guiGridListInsertRowAfter
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetColumnTitle
- guiGridListSetColumnWidth
- guiGridListSetHorizontalScrollPosition
- guiGridListSetItemColor
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListSetVerticalScrollPosition
Memos
- guiCreateMemo
- guiMemoGetCaretIndex
- guiMemoGetVerticalScrollPosition
- guiMemoSetVerticalScrollPosition
- guiMemoIsReadOnly
- guiMemoSetCaretIndex
- guiMemoSetReadOnly
Progressbars
Radio Buttons
Scrollbars
Scrollpanes
- guiCreateScrollPane
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
Static Images
Tab Panels
Tabs
Text Labels
- guiCreateLabel
- guiLabelGetColor
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign
Windows
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel