<?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=Fanbox</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=Fanbox"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Fanbox"/>
	<updated>2026-05-01T06:28:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsCreateImage&amp;diff=53842</id>
		<title>DgsCreateImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsCreateImage&amp;diff=53842"/>
		<updated>2018-01-27T15:55:58Z</updated>

		<summary type="html">&lt;p&gt;Fanbox: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function creates an image using image elements ( render target, texture element, shader and screen source and so on, even nothing just color ).&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element dgsCreateImage ( float x, float y, float width, float height, element image = nil, bool relative, [element parent = nil, int color = 0xFFFFFFFF ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
[[Image:gui-staticimage.png|frame|Example image .]]&lt;br /&gt;
*'''x:''' A float of the 2D x position of the image on a player's screen. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''y:''' A float of the 2D y position of the image on a player's screen. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''width:''' A float of the width of the image. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''height:''' A float of the height of the image. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''image:''' An texture element such as texture, render target, screen source, shader and so on. Or nil (color only).&lt;br /&gt;
*'''relative:''' This is whether sizes and positioning are relative. If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing measures relative to the parent.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''parent:''' This is the parent that the image is attached to. If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.&lt;br /&gt;
*'''color:''' A integer of the color of the image.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns [[element]] if image was created successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will display a rectangle on the player's screen.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client-side&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;
DGS = exports.dgs&lt;br /&gt;
local image = DGS:dgsCreateImage(100,100,200,200,_,false,_,tocolor(255,255,255,255))&lt;br /&gt;
setTimer(function()&lt;br /&gt;
	DGS:dgsSetProperty(image,&amp;quot;color&amp;quot;,tocolor(math.random(0,255),math.random(0,255),math.random(0,255),255))&lt;br /&gt;
end,100,0)&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;
{{DGSFUNCTIONS}}&lt;/div&gt;</summary>
		<author><name>Fanbox</name></author>
	</entry>
</feed>