<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/IsMouseInRing?action=history&amp;feed=atom</id>
	<title>IsMouseInRing - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/IsMouseInRing?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;action=history"/>
	<updated>2026-05-28T10:27:16Z</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=IsMouseInRing&amp;diff=53402&amp;oldid=prev</id>
		<title>Ceeser at 18:06, 17 January 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;diff=53402&amp;oldid=prev"/>
		<updated>2018-01-17T18:06:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:06, 17 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l198&quot;&gt;Line 198:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 198:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[findRotation]] is required to get the rotation of the cursor towards to the center of the ring.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[findRotation]] is required to get the rotation of the cursor towards to the center of the ring.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[:Category:Useful_Functions]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-53401:rev-53402 --&gt;
&lt;/table&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;diff=53401&amp;oldid=prev</id>
		<title>Ceeser at 18:05, 17 January 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;diff=53401&amp;oldid=prev"/>
		<updated>2018-01-17T18:05:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:05, 17 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l200&quot;&gt;Line 200:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 200:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==See Also==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[:Category:Useful_Functions]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Drawing_functions}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-53281:rev-53401 --&gt;
&lt;/table&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;diff=53281&amp;oldid=prev</id>
		<title>Ceeser: Corrected typos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;diff=53281&amp;oldid=prev"/>
		<updated>2018-01-07T01:09:04Z</updated>

		<summary type="html">&lt;p&gt;Corrected typos&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:09, 7 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;lowercasetitle/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;lowercasetitle/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function checks if is the cursor is inside of a ring-/part. Best to use &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;with &lt;/del&gt;with [[dxDrawCircle]] or &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;for &lt;/del&gt;circle / ring images.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function checks if is the cursor is inside of a ring-/part. Best &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;way &lt;/ins&gt;to use &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;it is &lt;/ins&gt;with [[dxDrawCircle]] or circle / ring images.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-53280:rev-53281 --&gt;
&lt;/table&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;diff=53280&amp;oldid=prev</id>
		<title>Ceeser: Page added</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseInRing&amp;diff=53280&amp;oldid=prev"/>
		<updated>2018-01-07T01:04:56Z</updated>

		<summary type="html">&lt;p&gt;Page added&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if is the cursor is inside of a ring-/part. Best to use with with [[dxDrawCircle]] or for circle / ring images.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isMouseInRing ( float posX, float posY, float radius, float width, float startAngle, float stopAngle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''posX:''' The center of the ring on the X-Axis.&lt;br /&gt;
*'''posY:''' The center of the ring on the Y-Axis.&lt;br /&gt;
*'''radius:''' The radius or the ring.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''width:''' The width (thickness) of the ring you want to check. The radius means the center of the ring, so the width goes in and outside the ring.&lt;br /&gt;
*'''startAngle:''' The degrees where you want to start the check.&lt;br /&gt;
*'''stopAngle:''' The degrees where you want to stop the check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the mouse is inside the ring-/part, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isMouseInRing(posX, posY, radius, width, startAngle, stopAngle)&lt;br /&gt;
    if isCursorShowing() then&lt;br /&gt;
	local SX, SY = guiGetScreenSize(); -- You can remove this line if you already got SX and SY for the screenSize&lt;br /&gt;
		&lt;br /&gt;
	if (not posX or not posY or not radius) then&lt;br /&gt;
	    outputDebugString(&amp;quot;isMouseInRing: Required arguments are missing&amp;quot;, 1);&lt;br /&gt;
	    return false&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	if not (width) then&lt;br /&gt;
	    width = SX / 50;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	if not (startAngle) then&lt;br /&gt;
	    startAngle = 0;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	if not (stopAngle) then&lt;br /&gt;
	    stopAngle = 359.99;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
        local cx, cy = getCursorPosition();&lt;br /&gt;
        local cx, cy = cx * SX, cy * SY;		&lt;br /&gt;
	local iMouseRot = findRotation(posX, posY, cx, cy) + 90;&lt;br /&gt;
		&lt;br /&gt;
	if (iMouseRot &amp;gt; 360) then&lt;br /&gt;
	    iMouseRot = iMouseRot - 360;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	local diffX = math.max(cx, posX) - math.min(cx, posX); -- Calculate the X-Axis difference between mouse and ring center&lt;br /&gt;
	local diffY = math.max(cy, posY) - math.min(cy, posY); -- Calculate the Y-Axis difference between mouse and ring center	&lt;br /&gt;
	local iMouseDistance = math.sqrt(diffX * diffX + diffY * diffY); -- Get the distance in pixels between mouse and ring center&lt;br /&gt;
&lt;br /&gt;
	if (startAngle &amp;gt; stopAngle) then -- Exchange start- and stop angle if startAngle is bigger then the stopAngle&lt;br /&gt;
	    local temp = startAngle;&lt;br /&gt;
	    startAngle = stopAngle;&lt;br /&gt;
	    stopAngle = temp;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (iMouseRot &amp;gt;= startAngle and iMouseRot &amp;lt;= stopAngle and iMouseDistance &amp;lt;= radius + width and iMouseDistance &amp;gt;= radius - width) then&lt;br /&gt;
	    return true -- The mouse is inside the ring-/part&lt;br /&gt;
	else&lt;br /&gt;
	    return false -- It's somewhere else&lt;br /&gt;
	end&lt;br /&gt;
    end&lt;br /&gt;
    outputDebugString(&amp;quot;isMouseInRing: Cursor is not showing!&amp;quot;, 1); -- Remove this line if you know your cursor shouldn't always be showing.&lt;br /&gt;
    return false -- Cursor is not showing&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
By: Ceeser&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This Example code will check if the mouse in the part of the [[dxDrawCircle]] ring and the ring will change its color if so.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Example variables&lt;br /&gt;
local SX, SY 	= guiGetScreenSize();&lt;br /&gt;
local iCenterX 	= SX / 2;&lt;br /&gt;
local iCenterY	= SY / 2;&lt;br /&gt;
local iRadius	= SX / 10; &lt;br /&gt;
local iWidth	= SX / 100;&lt;br /&gt;
&lt;br /&gt;
function renderCircle()&lt;br /&gt;
    if (isMouseInRing(iCenterX, iCenterY, iRadius, iWidth, 0, 120)) then -- Check if the mouse is inside the circle&lt;br /&gt;
	dxDrawCircle(iCenterX, iCenterY, iRadius, iWidth, 1, 0, 120, tocolor(0, 255, 0, 255), false); -- If yes (returned true) its green.&lt;br /&gt;
    else&lt;br /&gt;
	dxDrawCircle(iCenterX, iCenterY, iRadius, iWidth, 1, 0, 120, tocolor(255, 0, 0, 255), false); -- If no (returned false) its red.&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, renderCircle);&lt;br /&gt;
&lt;br /&gt;
function dxDrawCircle( posX, posY, radius, width, angleAmount, startAngle, stopAngle, color, postGUI )&lt;br /&gt;
    if ( type( posX ) ~= &amp;quot;number&amp;quot; ) or ( type( posY ) ~= &amp;quot;number&amp;quot; ) then&lt;br /&gt;
	return false&lt;br /&gt;
    end&lt;br /&gt;
	&lt;br /&gt;
    local function clamp( val, lower, upper )&lt;br /&gt;
	if ( lower &amp;gt; upper ) then lower, upper = upper, lower end&lt;br /&gt;
	return math.max( lower, math.min( upper, val ) )&lt;br /&gt;
    end&lt;br /&gt;
	&lt;br /&gt;
    radius = type( radius ) == &amp;quot;number&amp;quot; and radius or 50&lt;br /&gt;
    width = type( width ) == &amp;quot;number&amp;quot; and width or 5&lt;br /&gt;
    angleAmount = type( angleAmount ) == &amp;quot;number&amp;quot; and angleAmount or 1&lt;br /&gt;
    startAngle = clamp( type( startAngle ) == &amp;quot;number&amp;quot; and startAngle or 0, 0, 360 )&lt;br /&gt;
    stopAngle = clamp( type( stopAngle ) == &amp;quot;number&amp;quot; and stopAngle or 360, 0, 360 )&lt;br /&gt;
    color = color or tocolor( 255, 255, 255, 200 )&lt;br /&gt;
    postGUI = type( postGUI ) == &amp;quot;boolean&amp;quot; and postGUI or false&lt;br /&gt;
	&lt;br /&gt;
    if ( stopAngle &amp;lt; startAngle ) then&lt;br /&gt;
	local tempAngle = stopAngle&lt;br /&gt;
	stopAngle = startAngle&lt;br /&gt;
	startAngle = tempAngle&lt;br /&gt;
    end&lt;br /&gt;
	&lt;br /&gt;
    for i = startAngle, stopAngle, angleAmount do&lt;br /&gt;
	local startX = math.cos( math.rad( i ) ) * ( radius - width )&lt;br /&gt;
	local startY = math.sin( math.rad( i ) ) * ( radius - width )&lt;br /&gt;
	local endX = math.cos( math.rad( i ) ) * ( radius + width )&lt;br /&gt;
	local endY = math.sin( math.rad( i ) ) * ( radius + width )&lt;br /&gt;
	&lt;br /&gt;
	dxDrawLine( startX + posX, startY + posY, endX + posX, endY + posY, color, width, postGUI )&lt;br /&gt;
    end&lt;br /&gt;
	&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function isMouseInRing(posX, posY, radius, width, startAngle, stopAngle)&lt;br /&gt;
    if isCursorShowing() then&lt;br /&gt;
	local SX, SY = guiGetScreenSize(); -- You can remove this line if you already got SX and SY for the screenSize&lt;br /&gt;
		&lt;br /&gt;
	if (not posX or not posY or not radius) then&lt;br /&gt;
	    outputDebugString(&amp;quot;isMouseInRing: Required arguments are missing&amp;quot;, 1);&lt;br /&gt;
	    return false&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	if not (width) then&lt;br /&gt;
	    width = SX / 50;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	if not (startAngle) then&lt;br /&gt;
	    startAngle = 0;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	if not (stopAngle) then&lt;br /&gt;
	    stopAngle = 359.99;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
        local cx, cy = getCursorPosition();&lt;br /&gt;
        local cx, cy = cx * SX, cy * SY;		&lt;br /&gt;
	local iMouseRot = findRotation(posX, posY, cx, cy) + 90;&lt;br /&gt;
		&lt;br /&gt;
	if (iMouseRot &amp;gt; 360) then&lt;br /&gt;
	    iMouseRot = iMouseRot - 360;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	local diffX = math.max(cx, posX) - math.min(cx, posX); -- Calculate the X-Axis difference between mouse and ring center&lt;br /&gt;
	local diffY = math.max(cy, posY) - math.min(cy, posY); -- Calculate the Y-Axis difference between mouse and ring center	&lt;br /&gt;
	local iMouseDistance = math.sqrt(diffX * diffX + diffY * diffY); -- Get the distance in pixels between mouse and ring center&lt;br /&gt;
&lt;br /&gt;
	if (startAngle &amp;gt; stopAngle) then -- Exchange start- and stop angle if startAngle is bigger then the stopAngle&lt;br /&gt;
	    local temp = startAngle;&lt;br /&gt;
	    startAngle = stopAngle;&lt;br /&gt;
	    stopAngle = temp;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (iMouseRot &amp;gt;= startAngle and iMouseRot &amp;lt;= stopAngle and iMouseDistance &amp;lt;= radius + width and iMouseDistance &amp;gt;= radius - width) then&lt;br /&gt;
	    return true -- The mouse is inside the ring-/part&lt;br /&gt;
	else&lt;br /&gt;
	    return false -- It's somewhere else&lt;br /&gt;
	end&lt;br /&gt;
    end&lt;br /&gt;
    outputDebugString(&amp;quot;isMouseInRing: Cursor is not showing!&amp;quot;, 1); -- Remove this line if you know your cursor shouldn't always be showing.&lt;br /&gt;
    return false -- Cursor is not showing&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function findRotation( x1, y1, x2, y2 ) &lt;br /&gt;
    local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) )&lt;br /&gt;
    return t &amp;lt; 0 and t + 360 or t&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
By: Ceeser&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
'''The shown example''' needs way more resources then a simple [[dxDrawRectangle]] function. Using it too often may cause performance issues.&lt;br /&gt;
&lt;br /&gt;
The cursor must be visible to use this function. See [[showCursor]].&lt;br /&gt;
&lt;br /&gt;
[[findRotation]] is required to get the rotation of the cursor towards to the center of the ring.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
</feed>