guiLabelSetHorizontalAlign | Multi Theft Auto: Wiki Skip to content

guiLabelSetHorizontalAlign

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function sets the horizontal alignment of a text label.

OOP Syntax Help! I don't understand this!

  • Method: guilabel:setHorizontalAlign(...)
  • Variable: .horizontalAlign

Syntax

bool guiLabelSetHorizontalAlign ( element theLabel, string align, [ bool wordwrap = false ] )
Required Arguments
  • theLabel: The text label to set the horizontal alignment on.
  • align: The alignment type. Valid type strings are: "left" "center" "right"
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • wordwrap (default: false): Whether or not to enable wordwrap for the gui-label.

Returns

  • bool: value

Returns true on success, false otherwise.

Code Examples

shared
local label = guiCreateLabel(300,200,500,50,"Text",false)
guiLabelSetHorizontalAlign(label,"center")

See Also

GUI Functions