<?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=Ma2med</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=Ma2med"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Ma2med"/>
	<updated>2026-06-20T12:25:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawBorderedText&amp;diff=61700</id>
		<title>DxDrawBorderedText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawBorderedText&amp;diff=61700"/>
		<updated>2018-12-21T16:01:18Z</updated>

		<summary type="html">&lt;p&gt;Ma2med: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function renders a text with an outline. In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool dxDrawBorderedText ( int outline, string text, float left, float top [, float right = left, float bottom = top, int color = white,&lt;br /&gt;
                          float scaleXY = 1.0 [, float scaleY = 1.0 ], mixed font = &amp;quot;default&amp;quot;, string alignX = &amp;quot;left&amp;quot;, string alignY = &amp;quot;top&amp;quot;,&lt;br /&gt;
                          bool clip = false, bool wordBreak = false, bool postGUI = false, bool colorCoded = false, bool subPixelPositioning = false,&lt;br /&gt;
                          float fRotation = 0.0, float fRotationCenterX = 0.0, float fRotationCenterY = 0.0 ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''outline:''' an integer representing the text outline weight.&lt;br /&gt;
*'''text:''' the text to draw.&lt;br /&gt;
*'''left:''' the absolute X coordinate of the top left corner of the text.&lt;br /&gt;
*'''top:''' the absolute Y coordinate of the top left corner of the text.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''right:''' the absolute X coordinate of the right side of the text bounding box. Used for text aligning, clipping and word breaking.&lt;br /&gt;
*'''bottom:''' the absolute Y coordinate of the bottom side of the text bounding box. Used for text aligning, clipping and word breaking.&lt;br /&gt;
*'''color:''' the color of the text, a value produced by [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
*'''scale:''' the size of the text.{{New feature|3.0110|1.1|'''scale:''' can (optionally) be specified as two floats. i.e. '''scaleX, scaleY'''}}&lt;br /&gt;
*'''font:''' Either a custom [[DX font]] element or the name of a built-in DX font: '''Note: Some fonts are incompatible with certain languages such as Arabic.'''&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
*'''alignX:''' horizontal alignment of the text within the bounding box. Can be '''&amp;quot;left&amp;quot;''', '''&amp;quot;center&amp;quot;''' or '''&amp;quot;right&amp;quot;'''.&lt;br /&gt;
*'''alignY:''' vertical alignment of the text within the bounding box. Can be '''&amp;quot;top&amp;quot;''', '''&amp;quot;center&amp;quot;''' or '''&amp;quot;bottom&amp;quot;'''.&lt;br /&gt;
*'''clip:''' if set to ''true'', the parts of the text that don't fit within the bounding box will be cut off.&lt;br /&gt;
*'''wordBreak:''' if set to ''true'', the text will wrap to a new line whenever it reaches the right side of the bounding box. If ''false'', the text will always be completely on one line.&lt;br /&gt;
* '''postGUI:''' A bool representing whether the text should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
*'''colorCoded:''' Set to true to enable embedded #FFFFFF color codes. '''Note: clip and wordBreak are forced false if this is set.'''&lt;br /&gt;
*'''subPixelPositioning:''' A bool representing whether the text can be positioned sub-pixel-ly. Looks nicer for moving/scaling animations.&lt;br /&gt;
*'''fRotation:''' Rotation'''&lt;br /&gt;
*'''fRotationCenterX:''' Rotation Origin X'''&lt;br /&gt;
*'''fRotationCenterY:''' Rotation Origin Y'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function doesn't return values.&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 dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)&lt;br /&gt;
	for oX = (outline * -1), outline do&lt;br /&gt;
		for oY = (outline * -1), outline do&lt;br /&gt;
			dxDrawText (text, left + oX, top + oY, right + oX, bottom + oY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Author:''' Lord Henry&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example draws a text with outline on the screen.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside 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;local screenX, screenY = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
addEventHandler (&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
	dxDrawBorderedText (3, &amp;quot;mission completed!&amp;quot;, 0, 0, screenX, screenY - (screenY * 0.1), tocolor (150, 100, 0, 255), 3, &amp;quot;pricedown&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;, true, false)&lt;br /&gt;
	dxDrawBorderedText (3, &amp;quot;$1000000&amp;quot;, 0, screenY * 0.1, screenX, screenY, tocolor (255, 255, 255, 255), 3, &amp;quot;pricedown&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;, true, false)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Ma2med</name></author>
	</entry>
</feed>