<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/PL/guiCreateWindow?action=history&amp;feed=atom</id>
	<title>PL/guiCreateWindow - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/PL/guiCreateWindow?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PL/guiCreateWindow&amp;action=history"/>
	<updated>2026-04-03T17:40:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PL/guiCreateWindow&amp;diff=49903&amp;oldid=prev</id>
		<title>Necktrox: Necktrox moved page PL/GuiCreateWindow to PL/guiCreateWindow</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PL/guiCreateWindow&amp;diff=49903&amp;oldid=prev"/>
		<updated>2016-12-05T17:10:14Z</updated>

		<summary type="html">&lt;p&gt;Necktrox moved page &lt;a href=&quot;/wiki/PL/GuiCreateWindow&quot; class=&quot;mw-redirect&quot; title=&quot;PL/GuiCreateWindow&quot;&gt;PL/GuiCreateWindow&lt;/a&gt; to &lt;a href=&quot;/wiki/PL/guiCreateWindow&quot; title=&quot;PL/guiCreateWindow&quot;&gt;PL/guiCreateWindow&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:10, 5 December 2016&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-49902:rev-49903 --&gt;
&lt;/table&gt;</summary>
		<author><name>Necktrox</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PL/guiCreateWindow&amp;diff=49902&amp;oldid=prev</id>
		<title>Necktrox: Created page with &quot;__NOTOC__  {{Client function}} Ta funkcja służy do stworzenia nowego okna GUI. This provides a base for other gui elements to be created within.  However, windows do not hav...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PL/guiCreateWindow&amp;diff=49902&amp;oldid=prev"/>
		<updated>2016-12-05T17:07:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__  {{Client function}} Ta funkcja służy do stworzenia nowego okna GUI. This provides a base for other gui elements to be created within.  However, windows do not hav...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Ta funkcja służy do stworzenia nowego okna GUI. This provides a base for other gui elements to be created within.  However, windows do not have a parent and cannot be created in any GUI 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;
element guiCreateWindow ( float x, float y, float width, float height, string titleBarText, bool relative )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Wymagane Argumenty===&lt;br /&gt;
[[Image:gui-window.png|frame|Example Window.]]&lt;br /&gt;
*'''x:''' A float of the 2D x position of the GUI window 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 GUI window on a player's screen. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''width:''' A float of the width of the GUI window. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''height:''' A float of the height of the GUI window. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''titleBarText:''' A string of the text that will be displayed in the title bar of the window.&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 sizes/positions as a fraction of the screen size. If ''false'', then the size and co-ordinates are based on client's resolution, accessible using [[guiGetScreenSize]].&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a gui window element if it was created successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example creates a information window and adds two tabs to a &amp;quot;tabPanel&amp;quot; tabpanel, and adds some other gui elements to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myWindow = guiCreateWindow ( 0, 0, 0.5, 0.4, &amp;quot;Information&amp;quot;, true )  -- create a window which has &amp;quot;Information&amp;quot; in the title bar.&lt;br /&gt;
local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, myWindow )       -- create a tab panel which fills the whole window&lt;br /&gt;
local tabMap = guiCreateTab( &amp;quot;Map Information&amp;quot;, tabPanel )                -- create a tab named &amp;quot;Map Information&amp;quot; on 'tabPanel'&lt;br /&gt;
local tabHelp = guiCreateTab( &amp;quot;Help&amp;quot;, tabPanel )                          -- create another tab named &amp;quot;Help&amp;quot; on 'tabPanel'&lt;br /&gt;
&lt;br /&gt;
-- adds a label (text) to each tab&lt;br /&gt;
guiCreateLabel(0.02, 0.04, 0.94, 0.2, &amp;quot;This is information about the current map&amp;quot;, true, tabMap)&lt;br /&gt;
guiCreateLabel(0.02, 0.04, 0.94, 0.92, &amp;quot;This is help text.&amp;quot;, true, tabHelp)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example creates a weapon selection screen, complete with a window, gridlist and a button. Users can select a shotgun or a machine gun. The window is not movable or sizable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Setup some tables&lt;br /&gt;
&lt;br /&gt;
shotguns = {&lt;br /&gt;
      &amp;quot;chrome&amp;quot;,&lt;br /&gt;
      &amp;quot;sawn-off&amp;quot;,&lt;br /&gt;
      &amp;quot;combat&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
machineGun = {&lt;br /&gt;
      &amp;quot;m4&amp;quot;,&lt;br /&gt;
      &amp;quot;ak-47&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function setupWeaponSelection ( theResource )&lt;br /&gt;
      -- getResourceRootElement(getThisResource()) at the bottom means it will only create the gui on this resource start&lt;br /&gt;
      -- Create a window for our spawnscreen, with the title &amp;quot;Select your weapons&amp;quot;.&lt;br /&gt;
      spawnScreenMenu = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, &amp;quot;Select your weapons&amp;quot;, true )&lt;br /&gt;
      -- create an OK button to allow the user to confirm their selections, and attach it to the confirmSelection function&lt;br /&gt;
      spawnScreenOKButton = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, &amp;quot;OK&amp;quot;, true, spawnScreenMenu )&lt;br /&gt;
      -- ensure the user can't move or resize our spawnscreen.&lt;br /&gt;
      guiWindowSetMovable ( spawnScreenMenu, false )&lt;br /&gt;
      guiWindowSetSizable ( spawnScreenMenu, false )&lt;br /&gt;
      -- create our gridlist, which fills up most of the window.&lt;br /&gt;
      spawnScreenGridList = guiCreateGridList ( 0, 0.1, 1, 0.9, true, spawnScreenMenu )&lt;br /&gt;
      guiGridListSetSelectionMode ( spawnScreenGridList, 2 ) -- ensure the selection mode is one per column&lt;br /&gt;
      -- Since we have 2 sets of weapons, create a column for shotguns and one for machine guns&lt;br /&gt;
      guiGridListAddColumn ( spawnScreenGridList, &amp;quot;Shotguns&amp;quot;, 0.3 )&lt;br /&gt;
      guiGridListAddColumn ( spawnScreenGridList, &amp;quot;Machine guns&amp;quot;, 0.3 )&lt;br /&gt;
      -- next, we loop through our handguns table to add handgun items to the gridlist&lt;br /&gt;
      for key,weaponName in pairs(shotguns) do&lt;br /&gt;
            -- add a new row to our gridlist each time&lt;br /&gt;
            local row = guiGridListAddRow ( spawnScreenGridList )&lt;br /&gt;
            -- next, we set that row's text to the weapon name. Column is 1 since the &amp;quot;Shotguns&amp;quot; column was created first.&lt;br /&gt;
            guiGridListSetItemText ( spawnScreenGridList, row, 1, weaponName, false, false )&lt;br /&gt;
      end&lt;br /&gt;
      -- we repeat the process for other weapon list, changing the column number&lt;br /&gt;
      row = 0&lt;br /&gt;
      for key,weaponName in pairs(machineGun) do&lt;br /&gt;
            -- we don't need to create new rows as that was done in the previous loop&lt;br /&gt;
            -- we just set the row's text to the weapon name. Column is 2 since the &amp;quot;Machine guns&amp;quot; column was created second.&lt;br /&gt;
            guiGridListSetItemText ( spawnScreenGridList, row, 2, weaponName, false, false )&lt;br /&gt;
            row = row + 1 -- increase the row number&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), setupWeaponSelection )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[en:guiCreateWindow]]&lt;br /&gt;
[[ru:guiCreateWindow]]&lt;/div&gt;</summary>
		<author><name>Necktrox</name></author>
	</entry>
</feed>