DgsScrollPaneSetHorizontalScrollPosition

From Multi Theft Auto: Wiki

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

Syntax

bool dgsScrollPaneSetHorizontalScrollPosition ( element dgsScrollPane, float position )

Required Arguments

  • dgsScrollPane: The scroll pane you want to change the position of
  • position: a float ranging from 0 - 100

Returns

Returns true if the position was set, false otherwise.

Example

This example sets 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
	-- set the position
        DGS:dgsScrollPaneSetHorizontalScrollPosition( myScrollPane, 100 ) -- right end
        -- 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