<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/RU/guiCreateLabel?action=history&amp;feed=atom</id>
	<title>RU/guiCreateLabel - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/RU/guiCreateLabel?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/guiCreateLabel&amp;action=history"/>
	<updated>2026-10-25T07:05:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.1</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/guiCreateLabel&amp;diff=46251&amp;oldid=prev</id>
		<title>Fabervox: Необязательные параметры, пример</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/guiCreateLabel&amp;diff=46251&amp;oldid=prev"/>
		<updated>2015-12-21T17:43:11Z</updated>

		<summary type="html">&lt;p&gt;Необязательные параметры, пример&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;
[[Image:gui-label.png|frame|Пример метки.]]&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=100&amp;gt;&lt;br /&gt;
Эта функция создает новую текстовую метку. Метка является просто текстом, без возможности редактирования её пользователем. Если вы хотите установить больший текст, измените шрифт.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
==Синтаксис== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element guiCreateLabel ( float x, float y, float width, float height, string text, bool relative, [element parent = nil] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;x:&amp;#039;&amp;#039;&amp;#039; A float of the 2D x position of the GUI label on a player&amp;#039;s screen.  This is affected by the &amp;#039;&amp;#039;relative&amp;#039;&amp;#039; argument.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;y:&amp;#039;&amp;#039;&amp;#039; A float of the 2D y position of the GUI label on a player&amp;#039;s screen. This is affected by the &amp;#039;&amp;#039;relative&amp;#039;&amp;#039; argument.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;width:&amp;#039;&amp;#039;&amp;#039; A float of the width of the GUI label. This is affected by the &amp;#039;&amp;#039;relative&amp;#039;&amp;#039; argument.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;height:&amp;#039;&amp;#039;&amp;#039; A float of the height of the GUI label. This is affected by the &amp;#039;&amp;#039;relative&amp;#039;&amp;#039; argument.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;text:&amp;#039;&amp;#039;&amp;#039; A string of the text that will be displayed by the label.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;relative:&amp;#039;&amp;#039;&amp;#039; This is whether sizes and positioning are relative.  If this is &amp;#039;&amp;#039;true&amp;#039;&amp;#039;, then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent.&lt;br /&gt;
===Обязательные аргументы=== &lt;br /&gt;
[[Image:gui-window.png|frame|Пример окна.]]&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;x:&amp;#039;&amp;#039;&amp;#039; Позиция метки по оси X на экране игрока. Зависит от аргумента &amp;#039;&amp;#039;relative&amp;#039;&amp;#039;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;y:&amp;#039;&amp;#039;&amp;#039; Позиция метки по оси Y на экране игрока. Зависит от аргумента &amp;#039;&amp;#039;relative&amp;#039;&amp;#039;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;width:&amp;#039;&amp;#039;&amp;#039; Ширина метки. Зависит от аргумента &amp;#039;&amp;#039;relative&amp;#039;&amp;#039;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;height:&amp;#039;&amp;#039;&amp;#039; Высота метки. Зависит от аргумента &amp;#039;&amp;#039;relative&amp;#039;&amp;#039;.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;titleBarText:&amp;#039;&amp;#039;&amp;#039; Строка с текстом который будет выведен как метка.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;relative:&amp;#039;&amp;#039;&amp;#039; Определяет, относительны ли позиция и размер. Если указано &amp;#039;&amp;#039;true&amp;#039;&amp;#039;, то значения аргументов &amp;#039;&amp;#039;x, y, width&amp;#039;&amp;#039; и &amp;#039;&amp;#039;height&amp;#039;&amp;#039; должны быть между 0 и 1, относительны к размеру родителя.&lt;br /&gt;
&lt;br /&gt;
===Необязательные параметры=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;parent:&amp;#039;&amp;#039;&amp;#039; Родительский элемент к которому будет прикреплена.  If the &amp;#039;&amp;#039;relative&amp;#039;&amp;#039; argument is true, sizes and positioning will be made relative to this parent. If the &amp;#039;&amp;#039;relative&amp;#039;&amp;#039; argument is false, positioning will be the number of offset pixels from the parent&amp;#039;s origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.&lt;br /&gt;
&lt;br /&gt;
===Возвращает===&lt;br /&gt;
Возвращает [[GUI_widgets|элемент]] в случае успешного создания, &amp;#039;&amp;#039;false&amp;#039;&amp;#039; в противном случае.&lt;br /&gt;
&lt;br /&gt;
==Пример== &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example 1:&amp;#039;&amp;#039;&amp;#039; This example creates a information window and adds two tabs to a &amp;quot;tabPanel&amp;quot; tabpanel, and adds some gui labels to each tab.&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 &amp;#039;tabPanel&amp;#039;&lt;br /&gt;
local tabHelp = guiCreateTab( &amp;quot;Help&amp;quot;, tabPanel ) -- create another tab named &amp;quot;Help&amp;quot; on &amp;#039;tabPanel&amp;#039;&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;
&amp;#039;&amp;#039;&amp;#039;Example 2:&amp;#039;&amp;#039;&amp;#039; This example creates a label.  When an element is clicked, the label displays in the position of the element telling you what kind of element you have clicked.  It hides after 5 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myLabel = guiCreateLabel  ( 0, 0, 1, 1, &amp;quot;&amp;quot;, true )&lt;br /&gt;
&lt;br /&gt;
function addLabelOnClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement )&lt;br /&gt;
        --if an element was clicked on screen&lt;br /&gt;
        if ( clickedElement ) then&lt;br /&gt;
                --retreive the element type&lt;br /&gt;
                local elementType = getElementType ( clickedElement )&lt;br /&gt;
                --change the label text to that element type&lt;br /&gt;
                guiSetText ( myLabel, elementType )&lt;br /&gt;
                --and place it in the position of where the element is&lt;br /&gt;
                guiSetPosition ( myLabel, absoluteX, absoluteY, false )&lt;br /&gt;
                --hide the text by passing an empty string 5 seconds later&lt;br /&gt;
                setTimer ( guiSetText, 5000, 1, myLabel, &amp;quot;&amp;quot; )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientClick&amp;quot;, getRootElement(), addLabelOnClick )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Смотрите также==&lt;br /&gt;
{{RU/GUI_functions}}&lt;br /&gt;
[[en:guiCreateLabel]]&lt;/div&gt;</summary>
		<author><name>Fabervox</name></author>
	</entry>
</feed>