<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bolsonaro</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bolsonaro"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Bolsonaro"/>
	<updated>2026-05-01T15:06:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62451</id>
		<title>IsMouseOnGuiElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62451"/>
		<updated>2019-04-06T00:37:08Z</updated>

		<summary type="html">&lt;p&gt;Bolsonaro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a parent.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element isMouseOnGuiElement (element guiElement, element guiElementParent)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isMouseOnGuiElement(guiElement,guiElementParent)&lt;br /&gt;
    if isCursorShowing() then&lt;br /&gt;
        local sx,sy = guiGetScreenSize()&lt;br /&gt;
        local x,y = getCursorPosition()&lt;br /&gt;
        local wx,wy = 0,0&lt;br /&gt;
        x,y = x*sx, y*sy&lt;br /&gt;
        if guiElementParent then&lt;br /&gt;
            wx,wy = guiGetPosition(guiElementParent,false)&lt;br /&gt;
        end&lt;br /&gt;
        local bx,by = guiGetPosition(guiElement,false)&lt;br /&gt;
        local ex,ey = guiGetSize(guiElement,false)&lt;br /&gt;
        if x &amp;gt;= wx+bx and x &amp;lt;= wx+bx+ex and y &amp;gt;= wy+by and y &amp;lt;= wy+by+ey then&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''guiElement:''' The GUI element you want to check if the mouse is over it.&lt;br /&gt;
*'''guiElementParent:''' The parent element of the element you want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the mouse is over the element, otherwise it returns false.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local window = guiCreateWindow(500,500,200,200,&amp;quot;Test&amp;quot;,false)&lt;br /&gt;
local image = guiCreateStaticImage(25,25,50,50,&amp;quot;image.png&amp;quot;,false,window)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;,root,function()&lt;br /&gt;
    if isMouseOnGuiElement(image,window) then&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image2.png&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image.png&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[ru:guiCreateButton]]&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>Bolsonaro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62450</id>
		<title>IsMouseOnGuiElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62450"/>
		<updated>2019-04-06T00:36:51Z</updated>

		<summary type="html">&lt;p&gt;Bolsonaro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a parent.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element isMouseOnGuiElement(element guiElement, element guiElementParent)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isMouseOnGuiElement(guiElement,guiElementParent)&lt;br /&gt;
    if isCursorShowing() then&lt;br /&gt;
        local sx,sy = guiGetScreenSize()&lt;br /&gt;
        local x,y = getCursorPosition()&lt;br /&gt;
        local wx,wy = 0,0&lt;br /&gt;
        x,y = x*sx, y*sy&lt;br /&gt;
        if guiElementParent then&lt;br /&gt;
            wx,wy = guiGetPosition(guiElementParent,false)&lt;br /&gt;
        end&lt;br /&gt;
        local bx,by = guiGetPosition(guiElement,false)&lt;br /&gt;
        local ex,ey = guiGetSize(guiElement,false)&lt;br /&gt;
        if x &amp;gt;= wx+bx and x &amp;lt;= wx+bx+ex and y &amp;gt;= wy+by and y &amp;lt;= wy+by+ey then&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''guiElement:''' The GUI element you want to check if the mouse is over it.&lt;br /&gt;
*'''guiElementParent:''' The parent element of the element you want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the mouse is over the element, otherwise it returns false.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local window = guiCreateWindow(500,500,200,200,&amp;quot;Test&amp;quot;,false)&lt;br /&gt;
local image = guiCreateStaticImage(25,25,50,50,&amp;quot;image.png&amp;quot;,false,window)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;,root,function()&lt;br /&gt;
    if isMouseOnGuiElement(image,window) then&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image2.png&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image.png&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[ru:guiCreateButton]]&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>Bolsonaro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62449</id>
		<title>IsMouseOnGuiElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62449"/>
		<updated>2019-04-06T00:35:38Z</updated>

		<summary type="html">&lt;p&gt;Bolsonaro: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a parent.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isMouseOnGuiElement(guiElement,guiElementParent)&lt;br /&gt;
    if isCursorShowing() then&lt;br /&gt;
        local sx,sy = guiGetScreenSize()&lt;br /&gt;
        local x,y = getCursorPosition()&lt;br /&gt;
        local wx,wy = 0,0&lt;br /&gt;
        x,y = x*sx, y*sy&lt;br /&gt;
        if guiElementParent then&lt;br /&gt;
            wx,wy = guiGetPosition(guiElementParent,false)&lt;br /&gt;
        end&lt;br /&gt;
        local bx,by = guiGetPosition(guiElement,false)&lt;br /&gt;
        local ex,ey = guiGetSize(guiElement,false)&lt;br /&gt;
        if x &amp;gt;= wx+bx and x &amp;lt;= wx+bx+ex and y &amp;gt;= wy+by and y &amp;lt;= wy+by+ey then&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element isMouseOnGuiElement(element guiElement, element guiElementParent)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''guiElement:''' The GUI element you want to check if the mouse is over it.&lt;br /&gt;
*'''guiElementParent:''' The parent element of the element you want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the mouse is over the element, otherwise it returns false.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local window = guiCreateWindow(500,500,200,200,&amp;quot;Test&amp;quot;,false)&lt;br /&gt;
local image = guiCreateStaticImage(25,25,50,50,&amp;quot;image.png&amp;quot;,false,window)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;,root,function()&lt;br /&gt;
    if isMouseOnGuiElement(image,window) then&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image2.png&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image.png&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[ru:guiCreateButton]]&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>Bolsonaro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62448</id>
		<title>IsMouseOnGuiElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseOnGuiElement&amp;diff=62448"/>
		<updated>2019-04-06T00:33:06Z</updated>

		<summary type="html">&lt;p&gt;Bolsonaro: Created page with &amp;quot;__NOTOC__  {{Client function}} This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a p...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a parent.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isMouseOnGuiElement(guiElement,guiElementParent)&lt;br /&gt;
    local sx,sy = guiGetScreenSize()&lt;br /&gt;
    local x,y = getCursorPosition()&lt;br /&gt;
    local wx,wy = 0,0&lt;br /&gt;
    x,y = x*sx, y*sy&lt;br /&gt;
    if guiElementParent then&lt;br /&gt;
        wx,wy = guiGetPosition(guiElementParent,false)&lt;br /&gt;
    end&lt;br /&gt;
    local bx,by = guiGetPosition(guiElement,false)&lt;br /&gt;
    local ex,ey = guiGetSize(guiElement,false)&lt;br /&gt;
    if x &amp;gt;= wx+bx and x &amp;lt;= wx+bx+ex and y &amp;gt;= wy+by and y &amp;lt;= wy+by+ey then&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element isMouseOnGuiElement(element guiElement, element guiElementParent)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''guiElement:''' The GUI element you want to check if the mouse is over it.&lt;br /&gt;
*'''guiElementParent:''' The parent element of the element you want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the mouse is over the element, otherwise it returns false.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local window = guiCreateWindow(500,500,200,200,&amp;quot;Test&amp;quot;,false)&lt;br /&gt;
local image = guiCreateStaticImage(25,25,50,50,&amp;quot;image.png&amp;quot;,false,window)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;,root,function()&lt;br /&gt;
    if isMouseOnGuiElement(image,window) then&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image2.png&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        guiStaticImageLoadImage(image,&amp;quot;image.png&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[ru:guiCreateButton]]&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>Bolsonaro</name></author>
	</entry>
</feed>