<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/OnDgsMouseMove?action=history&amp;feed=atom</id>
	<title>OnDgsMouseMove - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/OnDgsMouseMove?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnDgsMouseMove&amp;action=history"/>
	<updated>2026-05-09T08:13:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnDgsMouseMove&amp;diff=63788&amp;oldid=prev</id>
		<title>Thisdp: Created page with &quot;{{Client event}} __NOTOC__  This event is triggered each time the user moves the mouse on top of a DGS element.  ==Parameters==  &lt;syntaxhighlight lang=&quot;lua&quot;&gt; int absoluteX, in...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnDgsMouseMove&amp;diff=63788&amp;oldid=prev"/>
		<updated>2019-08-16T13:19:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client event}} __NOTOC__  This event is triggered each time the user moves the mouse on top of a DGS element.  ==Parameters==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int absoluteX, in...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered each time the user moves the mouse on top of a DGS element.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int absoluteX, int absoluteY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
* '''absoluteX''':  the X position of the mouse cursor, in pixels, measured from the left side of the screen.&lt;br /&gt;
* '''absoluteY''':  the Y position of the mouse cursor, in pixels, measured from the top of the screen.&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the DGS element on which the mouse was moved.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
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 &amp;quot;TEST WINDOW&amp;quot; (the gui element).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
    function ( )&lt;br /&gt;
        DGS:dgsCreateWindow( 10, 200, 200, 150, &amp;quot;TEST WINDOW&amp;quot;, false );&lt;br /&gt;
        textLabel = DGS:dgsCreateLabel( 0, .9, 1, .1, &amp;quot;&amp;quot;, true );&lt;br /&gt;
        DGS:dgsLabelSetHorizontalAlign( textLabel, &amp;quot;center&amp;quot; );&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onDgsMouseMove&amp;quot;, getRootElement( ),&lt;br /&gt;
    function ( x, y )&lt;br /&gt;
        if source then&lt;br /&gt;
            if not DGS:dgsGetVisible( textLabel ) then DGS:dgsSetVisible( textLabel, true ) end&lt;br /&gt;
            DGS:dgsSetText( textLabel, &amp;quot;X: &amp;quot; .. tostring( x ) .. &amp;quot;;  Y: &amp;quot;.. tostring( y ) )&lt;br /&gt;
        else&lt;br /&gt;
            DGS:dgsSetVisible( textLabel, false );&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{DGSEVENTS}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
</feed>