<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DxDrawCircleOnElement?action=history&amp;feed=atom</id>
	<title>DxDrawCircleOnElement - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DxDrawCircleOnElement?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawCircleOnElement&amp;action=history"/>
	<updated>2026-04-08T13:54:53Z</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=DxDrawCircleOnElement&amp;diff=75597&amp;oldid=prev</id>
		<title>長瀞早瀬: /* Optional arguments */</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawCircleOnElement&amp;diff=75597&amp;oldid=prev"/>
		<updated>2022-10-19T08:13:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Optional arguments&lt;/span&gt;&lt;/span&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 08:13, 19 October 2022&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-l14&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&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;==Optional arguments==&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;==Optional arguments==&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;* '''marginFromTop''': The &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;height of the text, it's 1 by default&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;* '''marginFromTop''': The &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;circle margin from top&lt;/ins&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;* '''color''': The circle border color.&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;* '''color''': The circle border color.&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;* '''centerColor''': The circle center color.&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;* '''centerColor''': The circle center color.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-75596:rev-75597 --&gt;
&lt;/table&gt;</summary>
		<author><name>長瀞早瀬</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawCircleOnElement&amp;diff=75596&amp;oldid=prev</id>
		<title>長瀞早瀬: Created page with &quot;{{Useful Function}}&lt;lowercasetitle/&gt; __NOTOC__ This useful client function draws a circle on any element you choose. {{Note|You have to use onClientRender or onClientPreRender events with this function.}}  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt;boolean dxDrawCircleOnElement(element TheElement, int marginFromTop = 1.25, int radius = 1, int distance = 20, int color = tocolor(255,255,255), int centerColor = tocolor(255,255,255))&lt;/syntaxhighlight&gt; Image:Drawcircleo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawCircleOnElement&amp;diff=75596&amp;oldid=prev"/>
		<updated>2022-10-18T19:14:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt; __NOTOC__ This useful client function draws a circle on any element you choose. {{Note|You have to use &lt;a href=&quot;/wiki/OnClientRender&quot; title=&quot;OnClientRender&quot;&gt;onClientRender&lt;/a&gt; or &lt;a href=&quot;/wiki/OnClientPreRender&quot; title=&quot;OnClientPreRender&quot;&gt;onClientPreRender&lt;/a&gt; events with this function.}}  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawCircleOnElement(element TheElement, int marginFromTop = 1.25, int radius = 1, int distance = 20, int color = tocolor(255,255,255), int centerColor = tocolor(255,255,255))&amp;lt;/syntaxhighlight&amp;gt; Image:Drawcircleo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful Function}}&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This useful client function draws a circle on any element you choose.&lt;br /&gt;
{{Note|You have to use [[onClientRender]] or [[onClientPreRender]] events with this function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean dxDrawCircleOnElement(element TheElement, int marginFromTop = 1.25, int radius = 1, int distance = 20, int color = tocolor(255,255,255), int centerColor = tocolor(255,255,255))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:Drawcircleonelementdemo.jpg|thumb|Example of how it should looks like.|304x250px]]&lt;br /&gt;
&lt;br /&gt;
==Required arguments==&lt;br /&gt;
* '''TheElement''': The element you want to draw the text on it.&lt;br /&gt;
* '''radius''': An integer representing the radius scale of the circle that is being drawn.&lt;br /&gt;
* '''distance''': The distance you will be able to view the circle from.&lt;br /&gt;
&lt;br /&gt;
==Optional arguments==&lt;br /&gt;
* '''marginFromTop''': The height of the text, it's 1 by default.&lt;br /&gt;
* '''color''': The circle border color.&lt;br /&gt;
* '''centerColor''': The circle center color.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns '''true''' if successful, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Function source==&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 dxDrawCircleOnElement(TheElement,marginFromTop,radius,distance,color,centerColor)&lt;br /&gt;
	local x, y, z = getElementPosition(TheElement)&lt;br /&gt;
	local x2, y2, z2 = getCameraMatrix()&lt;br /&gt;
	local sx, sy = getScreenFromWorldPosition(x, y, z-marginFromTop)&lt;br /&gt;
	if(sx) and (sy) then&lt;br /&gt;
		local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)&lt;br /&gt;
		if(distanceBetweenPoints &amp;lt; distance) then&lt;br /&gt;
			dxDrawCircle(sx,sy,radius,nil,nil,color or tocolor(255,255,255,255),centerColor or tocolor(255,255,255,255))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>長瀞早瀬</name></author>
	</entry>
</feed>