Difference between revisions of "DgsScrollPaneGetHorizontalScrollPosition"

From Multi Theft Auto: Wiki
(Created page with "{{client function}} This function is used to get the position of a horizontal scroll pane as a percentage. ==Syntax== <syntaxhighlight lang="lua"> float dgsScrollPaneGetHoriz...")
 
Line 17: Line 17:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
DGS = exports.dgs
 
DGS = exports.dgs
 +
 
if ( myScrollPane ) then -- if the scroll pane exist then
 
if ( myScrollPane ) then -- if the scroll pane exist then
 
         -- get the position
 
         -- get the position

Revision as of 10:57, 16 August 2019

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

Syntax

float dgsScrollPaneGetHorizontalScrollPosition ( element horizontalScrollPane )

Required Arguments

  • horizontalScrollPane: The scroll pane you want to know the position of

Returns

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

Example

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

DGS = exports.dgs

if ( myScrollPane ) then -- if the scroll pane exist then
        -- get the position
	local position = DGS:dgsScrollPaneGetHorizontalScrollPosition( 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

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D