<?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=Majid+Alotaibi</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=Majid+Alotaibi"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Majid_Alotaibi"/>
	<updated>2026-04-28T17:54:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CenterWindow&amp;diff=26083</id>
		<title>CenterWindow</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CenterWindow&amp;diff=26083"/>
		<updated>2011-06-17T11:23:25Z</updated>

		<summary type="html">&lt;p&gt;Majid Alotaibi: Created page with &amp;quot;{{Useful Function}} __NOTOC__ This function center the window in any resolution.&amp;lt;br&amp;gt; * '''NOTE:''' This is made to be used clientside!.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string centerWind...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function center the window in any resolution.&amp;lt;br&amp;gt;&lt;br /&gt;
* '''NOTE:''' This is made to be used clientside!.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string centerWindow( element TheElement )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': The element you want to center it.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function centerWindow(center_window)&lt;br /&gt;
    local screenW,screenH=guiGetScreenSize()&lt;br /&gt;
    local windowW,windowH=guiGetSize(center_window,false)&lt;br /&gt;
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2&lt;br /&gt;
    guiSetPosition(center_window,x,y,false)&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;
==Example==&lt;br /&gt;
This example center the window.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local wnd = guiCreateWindow(...)&lt;br /&gt;
centerWindow(wnd)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Author: laserlaser&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Majid Alotaibi</name></author>
	</entry>
</feed>