DgsScrollBarGetScrollPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 24: Line 24:
outputChatBox( "The new scroll position is "..new )
outputChatBox( "The new scroll position is "..new )
end
end
addEventHandler( "onClientDgsScrollBarScrollPositionChange", root, OnScroll )
addEventHandler( "onDgsScrollBarScrollPositionChange", root, OnScroll )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{DGSFUNCTIONS}}
{{DGSFUNCTIONS}}

Revision as of 02:20, 3 February 2019

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

Syntax

float dgsScrollBarGetScrollPosition ( element theScrollBar )

Required Arguments

  • theScrollBar : The dgs scrollbar you want to check.

Returns

Returns a float ranging between 0 and 100, 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

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips