<?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=XX3</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=XX3"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/XX3"/>
	<updated>2026-04-25T04:52:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=25662</id>
		<title>GuiGetScreenSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=25662"/>
		<updated>2011-04-27T15:39:29Z</updated>

		<summary type="html">&lt;p&gt;XX3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function retrieves the local screen size according to the resolution they are using.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float float guiGetScreenSize ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns two floats representing the player's screen resolution, ''width'' and ''height''.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example checks whether a player is using a low resolution, and warns them that GUI may appear incorrect.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--setup a function when the resource starts&lt;br /&gt;
function checkResolutionOnStart ( theResource )&lt;br /&gt;
	--if the resource started isnt this resource, don't bother initiating the function&lt;br /&gt;
	if theResource ~= getThisResource() then return end&lt;br /&gt;
	local x,y = guiGetScreenSize() --get their screen size&lt;br /&gt;
	if ( x &amp;lt;= 640 ) and ( y &amp;lt;= 480 ) then --if their resolution is lower or equal to 640x480&lt;br /&gt;
		--warn them about GUI problems.&lt;br /&gt;
		outputChatBox ( &amp;quot;WARNING: You are running on a low resolution.  Some GUI may be placed or appear incorrectly.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
--attach the function to the event handler&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), checkResolutionOnStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using guiGetScreenSize to fit GUI &amp;amp; DX drawing in all resolutions==&lt;br /&gt;
To get the precise coordinates of a GUI element or DX drawings, you need to decide which edges of the screen you want to have them positioned against, then you just need to find the difference between your screen size and your position values.&lt;br /&gt;
&lt;br /&gt;
For example, there is a DX text. It fits on 1024x768 resolution.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now if you want it to fit on all resolutions. Then follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Add ''width'' and ''height'' variables to get GUI's screen size, here we use sWidth and sHeight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText( &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Subtract each of the DX text's position values from the screen size manually (remembering the resolution is 1024x768):&lt;br /&gt;
&lt;br /&gt;
*'''Left''' position value is 684, 1024-684 = 340&lt;br /&gt;
*'''Top''' position value is 731, 768-731 = 37&lt;br /&gt;
*'''Right''' position values is 732, 1024-732 = 292&lt;br /&gt;
*'''Bottom''' position value is 766, 768-766 = 2&lt;br /&gt;
&lt;br /&gt;
You may want to use a calculator to help you count.&lt;br /&gt;
&lt;br /&gt;
3. Now with the answer above remove all of the position values and replace it with the width or height variable subtract with the answer. Which would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(&amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the final results will be a DX text which will fit on all resolutions which will be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(&amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>XX3</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=25661</id>
		<title>GuiGetScreenSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=25661"/>
		<updated>2011-04-27T15:39:04Z</updated>

		<summary type="html">&lt;p&gt;XX3: /* Precise DX Drawing example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function retrieves the local screen size according to the resolution they are using.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float float guiGetScreenSize ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns two floats representing the player's screen resolution, ''width'' and ''height''.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example checks whether a player is using a low resolution, and warns them that GUI may appear incorrect.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--setup a function when the resource starts&lt;br /&gt;
function checkResolutionOnStart ( theResource )&lt;br /&gt;
	--if the resource started isnt this resource, don't bother initiating the function&lt;br /&gt;
	if theResource ~= getThisResource() then return end&lt;br /&gt;
	local x,y = guiGetScreenSize() --get their screen size&lt;br /&gt;
	if ( x &amp;lt;= 640 ) and ( y &amp;lt;= 480 ) then --if their resolution is lower or equal to 640x480&lt;br /&gt;
		--warn them about GUI problems.&lt;br /&gt;
		outputChatBox ( &amp;quot;WARNING: You are running on a low resolution.  Some GUI may be placed or appear incorrectly.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
--attach the function to the event handler&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), checkResolutionOnStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using guiGetScreenSize to fit GUI &amp;amp; DX drawing in all resolutions==&lt;br /&gt;
To get the precise coordinates of a GUI element or DX drawings, you need to decide which edges of the screen you want to have them positioned against, then you just need to find the difference between your screen size and your position values.&lt;br /&gt;
&lt;br /&gt;
For example, there is a DX text. It fits on 1024x768 resolution.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now if you want it to fit on all resolutions. Then follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Add ''width'' and ''height'' variables to get GUI's screen size, here we use sWidth and sHeight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText( &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Subtract each of the DX text's position values from the screen size manually (remembering the resolution is 1024x768):&lt;br /&gt;
&lt;br /&gt;
*'''Left''' position value is 684, 1024-684 = 340&lt;br /&gt;
*'''Top''' position value is 731, 768-731 = 37&lt;br /&gt;
*'''Right''' position values is 732, 1024-732 = 292&lt;br /&gt;
*'''Bottom''' position value is 766, 768-766 = 2&lt;br /&gt;
&lt;br /&gt;
You may want to use a calculator to help you count.&lt;br /&gt;
&lt;br /&gt;
3. Now with the answer above remove all of the position values and replace it with the width or height variable subtract with the answer. Which would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(&amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the final results will be a DX text which will fit on all resolutions which will be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(&amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>XX3</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=24530</id>
		<title>GuiGetScreenSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=24530"/>
		<updated>2010-11-15T09:02:40Z</updated>

		<summary type="html">&lt;p&gt;XX3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function retrieves the local screen size according to the resolution they are using.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float float guiGetScreenSize ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns two floats representing the player's screen resolution, ''width'' and ''height''.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example checks whether a player is using a low resolution, and warns them that GUI may appear incorrect.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--setup a function when the resource starts&lt;br /&gt;
function checkResolutionOnStart ( theResource )&lt;br /&gt;
	--if the resource started isnt this resource, don't bother initiating the function&lt;br /&gt;
	if theResource ~= getThisResource() then return end&lt;br /&gt;
	local x,y = guiGetScreenSize() --get their screen size&lt;br /&gt;
	if ( x &amp;lt;= 640 ) and ( y &amp;lt;= 480 ) then --if their resolution is lower or equal to 640x480&lt;br /&gt;
		--warn them about GUI problems.&lt;br /&gt;
		outputChatBox ( &amp;quot;WARNING: You are running on a low resolution.  Some GUI may be placed or appear incorrectly.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
--attach the function to the event handler&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), checkResolutionOnStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
To get the precise coordinates of a GUI element or DX drawings, you need to decide which edges of the screen you want to have them positioned against, then you just need to find the difference between your screen size and your position values.&lt;br /&gt;
&lt;br /&gt;
For example, there is a DX text. It fits on 1024x768 resolution.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now if you want it to fit on all resolutions. Then follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Add ''width'' and ''height'' variables to get GUI's screen size, here we use sWidth and sHeight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Subtract each of the DX text's position values from the screen size manually (remembering the resolution is 1024x768):&lt;br /&gt;
&lt;br /&gt;
*'''Left''' position value is 684, 1024-684 = 340&lt;br /&gt;
*'''Top''' position value is 731, 768-731 = 37&lt;br /&gt;
*'''Right''' position values is 732, 1024-732 = 292&lt;br /&gt;
*'''Bottom''' position value is 766, 768-766 = 2&lt;br /&gt;
&lt;br /&gt;
You may want to use a calculator to help you count.&lt;br /&gt;
&lt;br /&gt;
3. Now with the answer above remove all of the position values and replace it with the width or height variable subtract with the answer. Which would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the final results will be a DX text which will fit on all resolutions which will be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>XX3</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=24529</id>
		<title>GuiGetScreenSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGetScreenSize&amp;diff=24529"/>
		<updated>2010-11-15T09:00:57Z</updated>

		<summary type="html">&lt;p&gt;XX3: Adding some tips to help you make a GUI elements or DX drawings in all resolutions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function retrieves the local screen size according to the resolution they are using.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float float guiGetScreenSize ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns two floats representing the player's screen resolution, ''width'' and ''height''.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example checks whether a player is using a low resolution, and warns them that GUI may appear incorrect.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--setup a function when the resource starts&lt;br /&gt;
function checkResolutionOnStart ( theResource )&lt;br /&gt;
	--if the resource started isnt this resource, don't bother initiating the function&lt;br /&gt;
	if theResource ~= getThisResource() then return end&lt;br /&gt;
	local x,y = guiGetScreenSize() --get their screen size&lt;br /&gt;
	if ( x &amp;lt;= 640 ) and ( y &amp;lt;= 480 ) then --if their resolution is lower or equal to 640x480&lt;br /&gt;
		--warn them about GUI problems.&lt;br /&gt;
		outputChatBox ( &amp;quot;WARNING: You are running on a low resolution.  Some GUI may be placed or appear incorrectly.&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
--attach the function to the event handler&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), checkResolutionOnStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tips==&lt;br /&gt;
To get the precise coordinates of a GUI element or DX drawings, you need to decide which edges of the screen you want to have them positioned against, then you just need to find the difference between your screen size and your position values.&lt;br /&gt;
&lt;br /&gt;
For example, there is a DX text. It fits on 1024x768 resolution.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now if you want it to fit on all resolutions. Then follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Add ''width'' and ''height'' variables to get GUI's screen size, here we use sWidth and sHeight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,684.0,731.0,732.0,766.0,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Subtract each of the DX text's position values from the screen size manually (remembering the resolution is 1024x768):&lt;br /&gt;
&lt;br /&gt;
*'''Left''' position value is 684, 1024-684 = 340&lt;br /&gt;
*'''Top''' position value is 731, 768-731 = 37&lt;br /&gt;
*'''Right''' position values is 732, 1024-732 = 292&lt;br /&gt;
*'''Bottom''' position value is 766, 768-766 = 2&lt;br /&gt;
&lt;br /&gt;
You may want to use a calculator to help you count.&lt;br /&gt;
&lt;br /&gt;
3. Now with the answer above remove all of the position values and replace it with the guiGetScreenSize variable subtract with the answer. Which would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the final results will be a DX text which will fit on all resolutions which will be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function DXtext ()&lt;br /&gt;
local sWidth,sHeight = guiGetScreenSize() -- The variables&lt;br /&gt;
dxDrawText(tostring &amp;quot;Hello World!&amp;quot;,sWidth-340, sHeight-37, sWidth-292, sHeight-2,tocolor(0,255,255,175),1.0,&amp;quot;bankgothic&amp;quot;,&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;,false,false,false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getRootElement(), DXtext )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>XX3</name></author>
	</entry>
</feed>