<?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=LLL1L</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=LLL1L"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/LLL1L"/>
	<updated>2026-04-19T15:15:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XDrawSVG&amp;diff=82404</id>
		<title>XDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XDrawSVG&amp;diff=82404"/>
		<updated>2025-08-22T10:36:40Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: LLL1L moved page XDrawSVG to DxDrawSVG over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[DxDrawSVG]]&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82403</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82403"/>
		<updated>2025-08-22T10:36:40Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: LLL1L moved page XDrawSVG to DxDrawSVG over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.  &lt;br /&gt;
**This function runs on the client-side.**&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;(Client-side)&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
* This function should be used on the **client-side** only.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali  &lt;br /&gt;
Instagram : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DXDrawSVG&amp;diff=82402</id>
		<title>DXDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DXDrawSVG&amp;diff=82402"/>
		<updated>2025-08-22T10:36:01Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: LLL1L moved page DXDrawSVG to XDrawSVG over redirect: Fixing function name to proper case: dxDrawSVG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[XDrawSVG]]&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82401</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82401"/>
		<updated>2025-08-22T10:36:00Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: LLL1L moved page DXDrawSVG to XDrawSVG over redirect: Fixing function name to proper case: dxDrawSVG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.  &lt;br /&gt;
**This function runs on the client-side.**&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;(Client-side)&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
* This function should be used on the **client-side** only.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali  &lt;br /&gt;
Instagram : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82399</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82399"/>
		<updated>2025-08-22T10:35:18Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: LLL1L moved page XDrawSVG to DXDrawSVG: Fixing function name to proper case: dxDrawSVG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.  &lt;br /&gt;
**This function runs on the client-side.**&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;(Client-side)&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
* This function should be used on the **client-side** only.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali  &lt;br /&gt;
Instagram : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82397</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82397"/>
		<updated>2025-08-22T10:35:00Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: LLL1L moved page DxDrawSVG to XDrawSVG: Fixing function name to proper case: dxDrawSVG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.  &lt;br /&gt;
**This function runs on the client-side.**&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;(Client-side)&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
* This function should be used on the **client-side** only.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali  &lt;br /&gt;
Instagram : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82396</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82396"/>
		<updated>2025-08-22T10:33:22Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.  &lt;br /&gt;
**This function runs on the client-side.**&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;(Client-side)&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
* This function should be used on the **client-side** only.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali  &lt;br /&gt;
Instagram : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82395</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82395"/>
		<updated>2025-08-22T10:28:50Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.  &lt;br /&gt;
**This function runs on the client-side.**&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
* This function should be used on the **client-side** only.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali  &lt;br /&gt;
Instagram : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82394</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82394"/>
		<updated>2025-08-22T10:15:01Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: /* dxDrawSVG */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali &lt;br /&gt;
Instagram : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82393</id>
		<title>DxDrawSVG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawSVG&amp;diff=82393"/>
		<updated>2025-08-22T10:07:37Z</updated>

		<summary type="html">&lt;p&gt;LLL1L: Initial release of dxDrawSVG function with support for both raw SVG strings and external .svg files.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= dxDrawSVG =&lt;br /&gt;
&lt;br /&gt;
'''Author: Hussein Ali'''&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
Draws an SVG image on screen using dxDrawImage, with automatic caching.  &lt;br /&gt;
Supports both raw SVG strings and external .svg files from the resource folder.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(x, y, width, height, svgPathOrCode [, rotation = 0], [rotationCenterX = 0], [rotationCenterY = 0], [color = white], [postGUI = false])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required Arguments ==&lt;br /&gt;
* '''x''': *float* – X position on screen.&lt;br /&gt;
* '''y''': *float* – Y position on screen.&lt;br /&gt;
* '''width''': *float* – Width of the image.&lt;br /&gt;
* '''height''': *float* – Height of the image.&lt;br /&gt;
* '''svgPathOrCode''': *string* – Raw SVG code or a file path to `.svg`.&lt;br /&gt;
&lt;br /&gt;
== Optional Arguments ==&lt;br /&gt;
* '''rotation''': *float* – Rotation in degrees.&lt;br /&gt;
* '''rotationCenterX''': *float* – Rotation center X.&lt;br /&gt;
* '''rotationCenterY''': *float* – Rotation center Y.&lt;br /&gt;
* '''color''': *int* – Color (use tocolor()).&lt;br /&gt;
* '''postGUI''': *bool* – Whether to draw after GUI.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local HsoData = {}&lt;br /&gt;
&lt;br /&gt;
function dxDrawSVG(x, y, w, h, rawOrPath, ...)&lt;br /&gt;
    if not HsoData[rawOrPath] then&lt;br /&gt;
        if fileExists(rawOrPath) then&lt;br /&gt;
            local file = fileOpen(rawOrPath)&lt;br /&gt;
            if file then&lt;br /&gt;
                local content = fileRead(file, fileGetSize(file))&lt;br /&gt;
                fileClose(file)&lt;br /&gt;
                HsoData[rawOrPath] = svgCreate(w, h, content)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            HsoData[rawOrPath] = svgCreate(w, h, rawOrPath)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if HsoData[rawOrPath] then&lt;br /&gt;
        dxSetBlendMode('add')&lt;br /&gt;
        dxDrawImage(x, y, w, h, HsoData[rawOrPath], ...)&lt;br /&gt;
        dxSetBlendMode('blend')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Raw SVG string ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 128, 128, [[&lt;br /&gt;
&amp;lt;svg width=&amp;quot;128&amp;quot; height=&amp;quot;128&amp;quot; xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle cx=&amp;quot;64&amp;quot; cy=&amp;quot;64&amp;quot; r=&amp;quot;60&amp;quot; stroke=&amp;quot;white&amp;quot; stroke-width=&amp;quot;8&amp;quot; fill=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/svg&amp;gt;&lt;br /&gt;
]], 0, 0, 0, tocolor(255, 255, 255, 200))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: SVG file ==&lt;br /&gt;
'''meta.xml:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;files/icon.svg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Lua:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dxDrawSVG(400, 200, 64, 64, &amp;quot;files/icon.svg&amp;quot;, 0, 0, 0, tocolor(255, 255, 255, 255))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Supports both raw SVG content and external SVG files.&lt;br /&gt;
* Automatically caches each unique SVG to improve performance.&lt;br /&gt;
* Some complex SVGs may not be fully supported by svgCreate.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[dxDrawImage]]&lt;br /&gt;
* [[svgCreate]]&lt;br /&gt;
* [[Useful functions]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
* Function by '''Hussein Ali IG : pkw_3'''&lt;/div&gt;</summary>
		<author><name>LLL1L</name></author>
	</entry>
</feed>