DgsScrollBarGetScrollPosition

From Multi Theft Auto: Wiki

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

Syntax

float dgsScrollBarGetScrollPosition ( element theScrollBar [, bool isGrade = false ] )

Required Arguments

  • theScrollBar : The dgs scrollbar you want to check.

Optional Arguments

  • isGrade: A bool indicates whether the output value is grade or normal position. ( This only works when there are grades set in scroll bar )

Returns

Returns a float ranging between 0 and 100 when isGrade is false, representing the amount the dgs scrollbar has been scrolled.

Example

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

DGS = exports.dgs
local window = DGS:dgsCreateWindow(0.3,0.3,0.3,0.3,"Scroll-Position",true)
local scroll_bar = DGS:dgsCreateScrollBar(5,25,30,245,false,false,window)

function OnScroll()
	local new = DGS:dgsScrollBarGetScrollPosition( source )
	outputChatBox( "The new scroll position is "..new )
end
addEventHandler( "onDgsScrollBarScrollPositionChange", root, OnScroll )

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