<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DxDrawDashedLine?action=history&amp;feed=atom</id>
	<title>DxDrawDashedLine - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DxDrawDashedLine?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawDashedLine&amp;action=history"/>
	<updated>2026-05-11T06:32: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=DxDrawDashedLine&amp;diff=53207&amp;oldid=prev</id>
		<title>Renkon: /* Optional Arguments */</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawDashedLine&amp;diff=53207&amp;oldid=prev"/>
		<updated>2017-12-27T00:45:00Z</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 00:45, 27 December 2017&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-l18&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&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;*'''lengthSpace:''' An integer representing the length of the empty space between the dashes.&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;*'''lengthSpace:''' An integer representing the length of the empty space between the dashes.&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:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&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:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;*'''width:''' The width/thickness of the line&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;*'''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&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;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;===Returns===&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;===Returns===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-53206:rev-53207 --&gt;
&lt;/table&gt;</summary>
		<author><name>Renkon</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawDashedLine&amp;diff=53206&amp;oldid=prev</id>
		<title>Renkon: /* Example */</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawDashedLine&amp;diff=53206&amp;oldid=prev"/>
		<updated>2017-12-27T00:38:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&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 00:38, 27 December 2017&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-l59&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&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;addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&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;addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&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;	dxDrawDashedLine(100, 100, sW - 100, sH - 100, 10, 5, tocolor(255, 255, 255, 255), 2, false);&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;	dxDrawDashedLine(100, 100, sW - 100, sH - 100, 10, 5, tocolor(255, 255, 255, 255), 2, false);&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;	dxDrawDashedLine(100, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sW &lt;/del&gt;- 100, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sH &lt;/del&gt;- 100, 100, 10, 5, tocolor(255, 255, 255, 255), 2, false);&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;	dxDrawDashedLine(100, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sH &lt;/ins&gt;- 100, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sW &lt;/ins&gt;- 100, 100, 10, 5, tocolor(255, 255, 255, 255), 2, false);&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;end )&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;end )&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;&amp;lt;/syntaxhighlight&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;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-53205:rev-53206 --&gt;
&lt;/table&gt;</summary>
		<author><name>Renkon</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawDashedLine&amp;diff=53205&amp;oldid=prev</id>
		<title>Renkon: Created page with &quot;__NOTOC__ {{Useful Function}} This function lets you draw a line with dashes or dots.  ==Syntax==  &lt;syntaxhighlight lang=&quot;lua&quot;&gt; dxDrawDashedLine ( int startX, int startY, int...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawDashedLine&amp;diff=53205&amp;oldid=prev"/>
		<updated>2017-12-27T00:36:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{Useful Function}} This function lets you draw a line with dashes or dots.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; dxDrawDashedLine ( int startX, int startY, int...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function lets you draw a line with dashes or dots.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawDashedLine ( int startX, int startY, int endX, int endY, int lengthLine, [ int lengthSpace = lengthLine, int color = 0xFFFFFFFF, int width = 1, bool postGUI = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''startX:''' An integer representing the absolute start X position of the line, represented by pixels on the screen.&lt;br /&gt;
*'''startY:''' An integer representing the absolute start Y position of the line, represented by pixels on the screen.&lt;br /&gt;
*'''endX:''' An integer representing the absolute end X position of the line, represented by pixels on the screen.&lt;br /&gt;
*'''endY:''' An integer representing the absolute end Y position of the line, represented by pixels on the screen.&lt;br /&gt;
*'''lengthLine:''' An integer representing the length of each dash.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''lengthSpace:''' An integer representing the length of the empty space between the dashes.&lt;br /&gt;
*'''color:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function does not return anything.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client-Side Script&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 dxDrawDashedLine(sX, sY, eX, eY, lengthLine, lengthSpace, color, width, postGUI)&lt;br /&gt;
	lengthSpace = lengthSpace or lengthLine;&lt;br /&gt;
	color = color or tocolor(255, 255, 255, 255);&lt;br /&gt;
	width = width or 1;&lt;br /&gt;
	postGUI = postGUI or false;&lt;br /&gt;
	local length = getDistanceBetweenPoints2D(sX, sY, eX, eY);&lt;br /&gt;
	local linePartLength = lengthLine + lengthSpace;&lt;br /&gt;
	local lineParts = length / linePartLength;&lt;br /&gt;
	local xToAdd = (eX - sX) / lineParts;&lt;br /&gt;
	local yToAdd = (eY - sY) / lineParts;&lt;br /&gt;
	local lineRatio = lengthSpace / lengthLine;&lt;br /&gt;
	while (length &amp;gt; 0) do&lt;br /&gt;
		if (lengthLine &amp;gt; length) then&lt;br /&gt;
			dxDrawLine(sX, sY, eX, eY, color, width, postGUI);&lt;br /&gt;
			length = 0;&lt;br /&gt;
		else&lt;br /&gt;
			dxDrawLine(sX, sY, sX + xToAdd - xToAdd * lineRatio, sY + yToAdd - yToAdd * lineRatio, color, width, postGUI);&lt;br /&gt;
			sX = sX + xToAdd;&lt;br /&gt;
			sY = sY + yToAdd;&lt;br /&gt;
			length = length - linePartLength;&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;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client-Side Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example shows how to draw an X on the screen.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sW, sH = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
	dxDrawDashedLine(100, 100, sW - 100, sH - 100, 10, 5, tocolor(255, 255, 255, 255), 2, false);&lt;br /&gt;
	dxDrawDashedLine(100, sW - 100, sH - 100, 100, 10, 5, tocolor(255, 255, 255, 255), 2, false);&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;
'''Author: Renkon'''&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;br /&gt;
[[:Category:Useful_Functions]]&lt;/div&gt;</summary>
		<author><name>Renkon</name></author>
	</entry>
</feed>