<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Astrath:createLabel?action=history&amp;feed=atom</id>
	<title>Astrath:createLabel - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Astrath:createLabel?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Astrath:createLabel&amp;action=history"/>
	<updated>2026-05-07T10:22:32Z</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=Astrath:createLabel&amp;diff=82563&amp;oldid=prev</id>
		<title>Sybellex: Created page with &quot;= DxLabel:new =  {{Client function}} {{FuncDef|element DxLabel:new ( string text, float posX, float posY, float width, float height, element parent, boolean relative, string font, float fontsize, string horizontalAlign, string verticalAlign )}}  '''Description:''' Creates a new DX-based label element. Labels display text, support parent-relative positioning, custom fonts, colors, alignment, and optional hover effects. Each label instance is automatically registered in th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Astrath:createLabel&amp;diff=82563&amp;oldid=prev"/>
		<updated>2025-10-22T20:12:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= DxLabel:new =  {{Client function}} {{FuncDef|element DxLabel:new ( string text, float posX, float posY, float width, float height, element parent, boolean relative, string font, float fontsize, string horizontalAlign, string verticalAlign )}}  &amp;#039;&amp;#039;&amp;#039;Description:&amp;#039;&amp;#039;&amp;#039; Creates a new DX-based label element. Labels display text, support parent-relative positioning, custom fonts, colors, alignment, and optional hover effects. Each label instance is automatically registered in th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= DxLabel:new =&lt;br /&gt;
&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{FuncDef|element DxLabel:new ( string text, float posX, float posY, float width, float height, element parent, boolean relative, string font, float fontsize, string horizontalAlign, string verticalAlign )}}&lt;br /&gt;
&lt;br /&gt;
'''Description:'''&lt;br /&gt;
Creates a new DX-based label element. Labels display text, support parent-relative positioning, custom fonts, colors, alignment, and optional hover effects. Each label instance is automatically registered in the DX library.&lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
* text (string) – Text to display in the label.&lt;br /&gt;
* posX, posY (float) – Position on screen.&lt;br /&gt;
* width, height (float) – Size of the label.&lt;br /&gt;
* parent (element) – Parent DX element to attach this label to (optional).&lt;br /&gt;
* relative (boolean) – Position relative to parent (optional).&lt;br /&gt;
* font (string) – Font used for the text (optional, default: &amp;quot;default-bold&amp;quot;).&lt;br /&gt;
* fontsize (float) – Font size multiplier (optional, default: 1).&lt;br /&gt;
* horizontalAlign (string) – Horizontal alignment (&amp;quot;left&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;right&amp;quot;, optional, default: &amp;quot;center&amp;quot;).&lt;br /&gt;
* verticalAlign (string) – Vertical alignment (&amp;quot;top&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;bottom&amp;quot;, optional, default: &amp;quot;center&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
'''Returns:'''&lt;br /&gt;
: Returns the newly created DxLabel element.&lt;br /&gt;
&lt;br /&gt;
'''Methods:'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%; border:none;&amp;quot;&lt;br /&gt;
! Method !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Ath:destroy() || Destroys the label element and all its child elements.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setVisible(boolean) || Shows or hides the label.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setEnabled(boolean) || Enables or disables the label for interaction.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setText(string) || Sets the label text.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:getText() || Returns the current label text.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setFont(string) || Changes the label font.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setHoverable(boolean) || Enables or disables hover effect.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setColor(r, g, b, a, type) || Sets the main or hover text color.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setHorizontalAlign(string) || Sets horizontal alignment of the text.&lt;br /&gt;
|-&lt;br /&gt;
| Ath:setVerticalAlign(string) || Sets vertical alignment of the text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myLabel = DxLabel:new(&amp;quot;Hello World&amp;quot;, 100, 100, 200, 50)&lt;br /&gt;
&lt;br /&gt;
myLabel:setVisible(true)&lt;br /&gt;
myLabel:setHoverable(true)&lt;br /&gt;
myLabel:setText(&amp;quot;Welcome&amp;quot;)&lt;br /&gt;
myLabel:setColor(255, 200, 0, 255, &amp;quot;mainColor&amp;quot;)&lt;br /&gt;
myLabel:setHorizontalAlign(&amp;quot;center&amp;quot;)&lt;br /&gt;
myLabel:setVerticalAlign(&amp;quot;center&amp;quot;)&lt;br /&gt;
myLabel:draw()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''See also:'''&lt;br /&gt;
* [[Astrath]] – Main library page&lt;br /&gt;
* [[DxWindow:new]] – Page for window element reference&lt;br /&gt;
* [[DxButton:new]] – Page for button element reference&lt;br /&gt;
* [[onClientRender]] – Event used to render DX elements&lt;/div&gt;</summary>
		<author><name>Sybellex</name></author>
	</entry>
</feed>