GuiLabelSetHorizontalAlign: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Added OOP Method + Variable Information)
 
(8 intermediate revisions by 7 users not shown)
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
number guiLabelSetHorizontalAlign ( element theLabel, int align )
bool guiLabelSetHorizontalAlign ( element theLabel, string align, [ bool wordwrap = false ] )
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[Element/GUI/Text label|GuiLabel]]:setHorizontalAlign|horizontalAlign}}
===Required Arguments===  
===Required Arguments===  
*'''theLabel:''' The text label to set the horizontal alignment on.
*'''theLabel:''' The text label to set the horizontal alignment on.
*'''align:''' The alignment type. Valid types are:
*'''align:''' The alignment type. Valid type strings are:
**CGUI_ALIGN_LEFT = 0,
**"left"
**CGUI_ALIGN_RIGHT = 1,
**"center"
**CGUI_ALIGN_HORIZONTALCENTER = 2,
**"right"
**CGUI_ALIGN_LEFT_WORDWRAP = 4,
*'''wordwrap:''' Whether or not to enable wordwrap for the gui-label.
**CGUI_ALIGN_RIGHT_WORDWRAP = 5,
**CGUI_ALIGN_HORIZONTALCENTER_WORDWRAP = 6


===Returns===
===Returns===
Line 22: Line 20:


==Example==  
==Example==  
 
<section name="Example 1" class="client" show="true"><syntaxhighlight lang="lua">local label = guiCreateLabel(300,200,500,50,"Text",false)
guiLabelSetHorizontalAlign(label,"center")</syntaxhighlight></section>
==See Also==
==See Also==
{{GUI functions}}
{{GUI functions}}
{{GUI_events}}

Latest revision as of 11:47, 7 August 2019

This function sets the horizontal alignment of a text label.

Syntax

bool guiLabelSetHorizontalAlign ( element theLabel, string align, [ bool wordwrap = false ] )

OOP Syntax Help! I don't understand this!

Method: GuiLabel:setHorizontalAlign(...)
Variable: .horizontalAlign


Required Arguments

  • theLabel: The text label to set the horizontal alignment on.
  • align: The alignment type. Valid type strings are:
    • "left"
    • "center"
    • "right"
  • wordwrap: Whether or not to enable wordwrap for the gui-label.

Returns

Returns true on success, false otherwise.

Example

Click to collapse [-]
Example 1
local label = guiCreateLabel(300,200,500,50,"Text",false)
guiLabelSetHorizontalAlign(label,"center")

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI