OnDgsCursorMove
Jump to navigation
Jump to search
This event is triggered each time the user moves the mouse on top of a DGS element.
Parameters
int absoluteX, int absoluteY
- absoluteX: the X position of the mouse cursor, in pixels, measured from the left side of the screen.
- absoluteY: the Y position of the mouse cursor, in pixels, measured from the top of the screen.
Source
The source of this event is the DGS element on which the mouse was moved.
Example
This example creates a text label at the bottom of the screen that tells player the position of mouse when moved on top of a "TEST WINDOW" (the gui element).
DGS = exports.dgs addEventHandler( "onClientResourceStart", resourceRoot, function ( ) DGS:dgsCreateWindow( 10, 200, 200, 150, "TEST WINDOW", false ); textLabel = DGS:dgsCreateLabel( 0, .9, 1, .1, "", true ); DGS:dgsLabelSetHorizontalAlign( textLabel, "center" ); end ); addEventHandler( "onDgsCursorMove", getRootElement( ), function ( x, y ) if source then if not DGS:dgsGetVisible( textLabel ) then DGS:dgsSetVisible( textLabel, true ) end DGS:dgsSetText( textLabel, "X: " .. tostring( x ) .. "; Y: ".. tostring( y ) ) else DGS:dgsSetVisible( textLabel, false ); end end )
See Also
General
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange
Check Box
Combo Box
Drag'N Drop
Edit
Grid List
Menu
Selector
Mouse
- onDgsMousePreClick
- onDgsMouseClick
- onDgsMouseClickDown
- onDgsMouseClickUp
- onDgsMouseDrag
- onDgsMouseDoubleClick
- onDgsMouseDoubleClickDown
- onDgsMouseDoubleClickUp
- onDgsMouseDown
- onDgsMouseHover
- onDgsMouseEnter
- onDgsMouseLeave
- onDgsMouseMultiClick
- onDgsMouseMove
- onDgsMouseStay
- onDgsMouseUp
- onDgsMouseWheel
Radio Button
Switch Button
Tab
Animation
Plugin
Media
- onDgsMediaPlay
- onDgsMediaPause
- onDgsMediaStop
- onDgsMediaLoaded
- onDgsMediaTimeUpdate
- onDgsMediaBrowserReturn
Color Picker
QRCode
Remote Image
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled