<?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=Skurken</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=Skurken"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Skurken"/>
	<updated>2026-06-02T05:40:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=37251</id>
		<title>PlaySound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=37251"/>
		<updated>2013-10-02T17:51:25Z</updated>

		<summary type="html">&lt;p&gt;Skurken: Undo revision 37250 by OpenIDUser59 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] element and plays it immediately after creation for the local player.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note:''' The only supported audio formats are MP3, WAV, OGG, RIFF, MOD, XM, IT, S3M and PLS(e.g. Webstream).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound ( string soundPath, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' The [[filepath]] or URL of the sound file you want to play. (Sound specified by filepath has to be predefined in the [[meta.xml]] file with &amp;lt;file /&amp;gt; tag.)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' A [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''. Loop is not available for streaming sounds, only for sound files.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] element if the sound was successfully created, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function wasted (killer, weapon, bodypart) &lt;br /&gt;
	local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) --Play wasted.mp3 from the sounds folder&lt;br /&gt;
	setSoundVolume(sound, 0.5) -- set the sound volume to 50%&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wasted) --add the event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:playSound]]&lt;br /&gt;
[[DE:playSound]]&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxConvertPixels&amp;diff=37236</id>
		<title>DxConvertPixels</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxConvertPixels&amp;diff=37236"/>
		<updated>2013-09-28T18:26:47Z</updated>

		<summary type="html">&lt;p&gt;Skurken: No point of the section as it's already a client function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function converts [[Texture_pixels|pixels]] from one format to another.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string dxConvertPixels ( string pixels, string newFormat [, int quality = 80 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to convert the format of&lt;br /&gt;
*'''newFormat :''' The new format required (''''plain'''' or ''''png'''' or ''''jpeg'''')&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''quality :''' The quality of the returned pixels if the new format is ''''jpeg''''&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a copy of the pixels in the new format, or ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
The code opens an image, read its pixels, convert the pixels to PNG, and then save it. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local pngPixels = dxConvertPixels(pixels, 'png')&lt;br /&gt;
  local newImg = fileCreate('img.png')&lt;br /&gt;
  fileWrite(newImg, pngPixels)&lt;br /&gt;
  fileClose(newImg)&lt;br /&gt;
  fileClose(img)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetPixelsFormat&amp;diff=37235</id>
		<title>DxGetPixelsFormat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetPixelsFormat&amp;diff=37235"/>
		<updated>2013-09-28T18:26:11Z</updated>

		<summary type="html">&lt;p&gt;Skurken: No point of the section as it's already a client function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the format of [[Texture_pixels|pixels]] contained in a string.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string dxGetPixelsFormat ( string pixels )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to get the format of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns the format of the pixels if successful (''''plain'''' or ''''png'''' or ''''jpeg''''), ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
The example loads an image, gets its pixels, and outputs the pixels format. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local pixelsFormat = dxGetPixelsFormat(pixels)&lt;br /&gt;
  outputChatBox('Pixels format is: ' .. pixelsFormat)&lt;br /&gt;
  fileClose(img)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetPixelsSize&amp;diff=37234</id>
		<title>DxGetPixelsSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetPixelsSize&amp;diff=37234"/>
		<updated>2013-09-28T18:25:00Z</updated>

		<summary type="html">&lt;p&gt;Skurken: No point of the section as it's already a client function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets the dimensions of [[Texture_pixels|pixels]] contained in a string. It works with all pixel formats.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int int dxGetPixelsSize ( string pixels )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to get the dimensions of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns width and height of the pixels if successful, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
The example loads an image, gets its pixels, and outputs the pixels size. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local size = dxGetPixelsSize(pixels)&lt;br /&gt;
  outputChatBox('Pixels size is: ' .. size)&lt;br /&gt;
  fileClose(img)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HttpSetResponseHeader&amp;diff=37231</id>
		<title>HttpSetResponseHeader</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HttpSetResponseHeader&amp;diff=37231"/>
		<updated>2013-09-28T12:30:58Z</updated>

		<summary type="html">&lt;p&gt;Skurken: Example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{HTTP function}}&lt;br /&gt;
This function sets the value for the specified HTTP response header of the current HTML page.&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 httpSetResponseHeader ( string headerName, string headerValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''headerName:''' the HTTP header whose value is being set. You can find a list of header names [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html here]. Header names should be all ''lower case'' letters.&lt;br /&gt;
*'''headerValue:''' the new value for the specified header.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the header value was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Using httpSetResponseHeader to set the content type. (Example from [[httpWrite]])&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;*&lt;br /&gt;
local file = fileOpen ( &amp;quot;icons/icon.png&amp;quot; )&lt;br /&gt;
if file then&lt;br /&gt;
	while not fileIsEOF(file) do            &lt;br /&gt;
		buffer = fileRead(file, 500)         &lt;br /&gt;
		httpWrite(buffer, buffer:len())&lt;br /&gt;
	end&lt;br /&gt;
	fileClose(file)                           &lt;br /&gt;
	httpSetResponseHeader ( &amp;quot;content-type&amp;quot;, &amp;quot;image/png&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
	*&amp;gt;&lt;br /&gt;
	Could not read file&lt;br /&gt;
	&amp;lt;*&lt;br /&gt;
end&lt;br /&gt;
*&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{HTTP functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementWithinAColShape&amp;diff=37230</id>
		<title>IsElementWithinAColShape</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementWithinAColShape&amp;diff=37230"/>
		<updated>2013-09-28T11:25:38Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&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 the [[element]] is in a [[colshape]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; colshape / bool isElementWithinAColShape ( element theElement ) &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&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;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; colshape / bool isElementWithinAColShape ( [ element theElement ] ) &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required/Optional Arguments===&lt;br /&gt;
* '''theElement''': The element you want to check. (If not entered in client-side function, local player will be checked instead.)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[colshape]] the [[element]] is in else false if the element isn't in one or no arguments were passed.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function isElementWithinAColShape(element)&lt;br /&gt;
	if element or isElement(element)then&lt;br /&gt;
		for _,colshape in ipairs(getElementsByType(&amp;quot;colshape&amp;quot;))do&lt;br /&gt;
			if isElementWithinColShape(element,colshape) then&lt;br /&gt;
				return colshape&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	outputDebugString(&amp;quot;isElementWithinAColShape - Invalid arguments or element does not exist&amp;quot;,1)&lt;br /&gt;
	return false&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&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;function isElementWithinAColShape(element)&lt;br /&gt;
	element = element or localPlayer or getLocalPlayer()&lt;br /&gt;
	if element or isElement(element)then&lt;br /&gt;
		for _,colshape in ipairs(getElementsByType(&amp;quot;colshape&amp;quot;))do&lt;br /&gt;
			if isElementWithinColShape(element,colshape) then&lt;br /&gt;
				return colshape&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	outputDebugString(&amp;quot;isElementWithinAColShape - Element does not exist&amp;quot;,1)&lt;br /&gt;
	return false&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--ToDo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTeamFromColor&amp;diff=37229</id>
		<title>GetTeamFromColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTeamFromColor&amp;diff=37229"/>
		<updated>2013-09-28T11:23:05Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets a team from it's color.&lt;br /&gt;
'''Note:''' If 2 teams has the same color, then the first one found will be returned!&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;team getTeamFromColor ( int r, int g, int b)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''r''': The red color.&lt;br /&gt;
* '''g''': The green color.&lt;br /&gt;
* '''b''': The blue color.&lt;br /&gt;
&lt;br /&gt;
===Return===&lt;br /&gt;
Returns a [[team]] else false if bad arguments were given or a team doesn't have the same color.&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 getTeamFromColor(r,g,b)&lt;br /&gt;
	if &lt;br /&gt;
		not r or type(r)~=&amp;quot;number&amp;quot; or r&amp;lt;0 or r&amp;gt;255 or&lt;br /&gt;
		not g or type(g)~=&amp;quot;number&amp;quot; or g&amp;lt;0 or g&amp;gt;255 or&lt;br /&gt;
		not b or type(b)~=&amp;quot;number&amp;quot; or b&amp;lt;0 or b&amp;gt;255&lt;br /&gt;
	then outputDebugString(&amp;quot;getTeamFromColor - Bad Arguments&amp;quot;,0) return false end&lt;br /&gt;
		&lt;br /&gt;
	for _,team in ipairs(getElementsByType(&amp;quot;team&amp;quot;))do&lt;br /&gt;
		local tR,tG,tB = getTeamColor(team)&lt;br /&gt;
		if tR==r and tG==g and tB==b then&lt;br /&gt;
			return team&lt;br /&gt;
		end&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;
==Example==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Author: Jaysds1&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetKeyBoundToFunction&amp;diff=37228</id>
		<title>GetKeyBoundToFunction</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetKeyBoundToFunction&amp;diff=37228"/>
		<updated>2013-09-28T11:20:15Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
getKeyBoundToFunction allows retrieval of the first key bound to a function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string getKeyBoundToFunction( player thePlayer, function theFunction )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player you are checking the function bound to a key&lt;br /&gt;
*'''theFunction:''' The function in which you would like to check the bound key&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string of the first key the function was bound to.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;string getKeyBoundToFunction( function theFunction )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theFunction:''' The function in which you would like to check the bound key&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string of the first key the function was bound to.&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&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
/key command gives bounded key to our chat function&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function chat ()&lt;br /&gt;
  outputChatBox(&amp;quot;Test&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
bindKey(&amp;quot;F2&amp;quot;,&amp;quot;down&amp;quot;,chat)&lt;br /&gt;
&lt;br /&gt;
function key()&lt;br /&gt;
  local boundKey = getKeyBoundToFunction(chat)&lt;br /&gt;
  outputChatBox(boundKey)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;key&amp;quot;,key)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example written by '''Samurai'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Input_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetPixelsSize&amp;diff=37227</id>
		<title>DxGetPixelsSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetPixelsSize&amp;diff=37227"/>
		<updated>2013-09-28T11:15:48Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets the dimensions of [[Texture_pixels|pixels]] contained in a string. It works with all pixel formats.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int int dxGetPixelsSize ( string pixels )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to get the dimensions of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns width and height of the pixels if successful, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
The example loads an image, gets its pixels, and outputs the pixels size. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local size = dxGetPixelsSize(pixels)&lt;br /&gt;
  outputChatBox('Pixels size is: ' .. size)&lt;br /&gt;
  fileClose(img)&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Skurken&amp;diff=37226</id>
		<title>User:Skurken</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Skurken&amp;diff=37226"/>
		<updated>2013-09-27T21:46:58Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contributions to the Wiki =&lt;br /&gt;
&lt;br /&gt;
'''27 September 2013''' Wrote example for [[dxConvertPixels]], [[DxDrawImageSection]], [[DxGetPixelsFormat]], [[DxGetPixelsSize]]&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetPixelsSize&amp;diff=37225</id>
		<title>DxGetPixelsSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetPixelsSize&amp;diff=37225"/>
		<updated>2013-09-27T21:43:41Z</updated>

		<summary type="html">&lt;p&gt;Skurken: Example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets the dimensions of [[Texture_pixels|pixels]] contained in a string. It works with all pixel formats.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int int dxGetPixelsSize ( string pixels )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to get the dimensions of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns width and height of the pixels if successful, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
The example loads an image, gets its pixels, and outputs the pixels size. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local size = dxGetPixelsSize(pixels)&lt;br /&gt;
  outputChatBox('Pixels size is: ' .. size)&lt;br /&gt;
  fileClose(img)&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetPixelsFormat&amp;diff=37224</id>
		<title>DxGetPixelsFormat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetPixelsFormat&amp;diff=37224"/>
		<updated>2013-09-27T21:41:58Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the format of [[Texture_pixels|pixels]] contained in a string.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string dxGetPixelsFormat ( string pixels )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to get the format of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns the format of the pixels if successful (''''plain'''' or ''''png'''' or ''''jpeg''''), ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
The example loads an image, gets its pixels, and outputs the pixels format. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local pixelsFormat = dxGetPixelsFormat(pixels)&lt;br /&gt;
  outputChatBox('Pixels format is: ' .. pixelsFormat)&lt;br /&gt;
  fileClose(img)&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetPixelsFormat&amp;diff=37223</id>
		<title>DxGetPixelsFormat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetPixelsFormat&amp;diff=37223"/>
		<updated>2013-09-27T21:38:35Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the format of [[Texture_pixels|pixels]] contained in a string.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string dxGetPixelsFormat ( string pixels )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to get the format of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns the format of the pixels if successful (''''plain'''' or ''''png'''' or ''''jpeg''''), ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
The example loads an image, gets its pixels, and outputs the pixels format.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local pixelsFormat = dxGetPixelsFormat(pixels)&lt;br /&gt;
  outputChatBox('Pixels format is: ' .. pixelsFormat)&lt;br /&gt;
  fileClose(img)&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=37222</id>
		<title>DxDrawMaterialLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=37222"/>
		<updated>2013-09-27T21:22:46Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&lt;br /&gt;
&lt;br /&gt;
3D lines are drawn at a particular place in the [[Game_Processing_Order|game processing order]], so use [[onClientPreRender]] for drawing if you are attaching them to world elements.&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 dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ,&lt;br /&gt;
                            element material, int width, [, int color = white, float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''color:''' An [[int|integer]] of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The direction the front of the line should face towards. If this is not set, the front of the line always faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
Draws an Image ( &amp;quot;test.png&amp;quot; Download : [http://i.epvpimg.com/dwsTe.png test.png] ) from the Position 0,0,3 to 0,0,15&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local img = dxCreateTexture(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()  -- x,y,z, targetx,targety,targetz,texture,width,color&lt;br /&gt;
		dxDrawMaterialLine3D (0,0,3,0,0,15,img, 7, tocolor(255,255,255,255))&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&amp;diff=37221</id>
		<title>DxDrawImageSection</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&amp;diff=37221"/>
		<updated>2013-09-27T21:13:19Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image 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;&lt;br /&gt;
bool dxDrawImageSection ( float posX, float posY, float width, float height, float u, float v, float usize, float vsize, mixed image, &lt;br /&gt;
[ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = white, bool postGUI = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''posX:''' the absolute X coordinate of the top left corner of the image&lt;br /&gt;
*'''posY:''' the absolute Y coordinate of the top left corner of the image&lt;br /&gt;
*'''width:''' the absolute width of the image&lt;br /&gt;
*'''height:''' the absolute height of the image&lt;br /&gt;
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image&lt;br /&gt;
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image&lt;br /&gt;
*'''usize:''' the absolute width of the image section&lt;br /&gt;
*'''vsize:''' the absolute height of the image section&lt;br /&gt;
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''rotation:''' the rotation, in degrees for the image.&lt;br /&gt;
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientRender', root, function()&lt;br /&gt;
  dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section&lt;br /&gt;
  dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference&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;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&amp;diff=37220</id>
		<title>DxDrawImageSection</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&amp;diff=37220"/>
		<updated>2013-09-27T21:13:05Z</updated>

		<summary type="html">&lt;p&gt;Skurken: Example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image 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;&lt;br /&gt;
bool dxDrawImageSection ( float posX, float posY, float width, float height, float u, float v, float usize, float vsize, mixed image, &lt;br /&gt;
[ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = white, bool postGUI = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''posX:''' the absolute X coordinate of the top left corner of the image&lt;br /&gt;
*'''posY:''' the absolute Y coordinate of the top left corner of the image&lt;br /&gt;
*'''width:''' the absolute width of the image&lt;br /&gt;
*'''height:''' the absolute height of the image&lt;br /&gt;
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image&lt;br /&gt;
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image&lt;br /&gt;
*'''usize:''' the absolute width of the image section&lt;br /&gt;
*'''vsize:''' the absolute height of the image section&lt;br /&gt;
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''rotation:''' the rotation, in degrees for the image.&lt;br /&gt;
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientRender', root, function()&lt;br /&gt;
  dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section&lt;br /&gt;
  dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference&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;
{{Drawing_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Skurken&amp;diff=37219</id>
		<title>User:Skurken</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Skurken&amp;diff=37219"/>
		<updated>2013-09-27T20:48:37Z</updated>

		<summary type="html">&lt;p&gt;Skurken: Created page with &amp;quot;= Contributions to the Wiki =  '''27 September 2013''' Wrote example for dxConvertPixels&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Contributions to the Wiki =&lt;br /&gt;
&lt;br /&gt;
'''27 September 2013''' Wrote example for [[dxConvertPixels]]&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxConvertPixels&amp;diff=37218</id>
		<title>DxConvertPixels</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxConvertPixels&amp;diff=37218"/>
		<updated>2013-09-27T20:23:24Z</updated>

		<summary type="html">&lt;p&gt;Skurken: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function converts [[Texture_pixels|pixels]] from one format to another.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string dxConvertPixels ( string pixels, string newFormat [, int quality = 80 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''pixels :''' The pixels to convert the format of&lt;br /&gt;
*'''newFormat :''' The new format required (''''plain'''' or ''''png'''' or ''''jpeg'''')&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''quality :''' The quality of the returned pixels if the new format is ''''jpeg''''&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a copy of the pixels in the new format, or ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &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;
The code opens an image, read its pixels, convert the pixels to PNG, and then save it. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
  local img = fileOpen('img.jpg')&lt;br /&gt;
  local pixels = fileRead(img, fileGetSize(img))&lt;br /&gt;
  local pngPixels = dxConvertPixels(pixels, 'png')&lt;br /&gt;
  local newImg = fileCreate('img.png')&lt;br /&gt;
  fileWrite(newImg, pngPixels)&lt;br /&gt;
  fileClose(newImg)&lt;br /&gt;
  fileClose(img)&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Skurken</name></author>
	</entry>
</feed>