Dgs-dxlabel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


==Main Functions==
==Main Functions==
*[[dgsDxGUISetProperty]]
*[[dgsSetProperty]]
*[[dgsDxGUIGetProperty]]
*[[dgsGetProperty]]


==Properties==
==Properties==
===text===
===text===
This is equivalent to [[dgsDxGUISetText]]/[[dgsDxGUIGetText]].
This is equivalent to [[dgsSetText]]/[[dgsGetText]].
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"text",text)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"text",text)</syntaxhighlight>
*'''text''' : A string of the text of the label.
*'''text''' : A string of the text of the label.


===textcolor===
===textcolor===
The color which can be translated by [[tocolor]] of the text of the label.
The color which can be translated by [[tocolor]] of the text of the label.
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"textcolor",textcolor)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"textcolor",textcolor)</syntaxhighlight>
*'''textcolor''' : An integer of the color of the text of the label.
*'''textcolor''' : An integer of the color of the text of the label.


===textsize===
===textsize===
The scale of the text of the label. ''Learn More [[dxDrawText]]''
The scale of the text of the label. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"textsize",{scaleX,scaleY})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"textsize",{scaleX,scaleY})</syntaxhighlight>
*'''scaleX''' : A float of the 2D X scale of the text of the label.
*'''scaleX''' : A float of the 2D X scale of the text of the label.
*'''scaleY''' : A float of the 2D Y scale of the text of the label.
*'''scaleY''' : A float of the 2D Y scale of the text of the label.
Line 26: Line 26:
===shadow===
===shadow===
The shadow text of the label.
The shadow text of the label.
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"shadow",{offsetX,offsetY,color})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"shadow",{offsetX,offsetY,color})</syntaxhighlight>
*'''offsetX''' : A float of the 2D X offset of the shadow text of the label.
*'''offsetX''' : A float of the 2D X offset of the shadow text of the label.
*'''offsetY''' : A float of the 2D Y offset of the shadow text of the label.
*'''offsetY''' : A float of the 2D Y offset of the shadow text of the label.
*'''color''' : An integer of the color of the shadow text of the label.
*'''color''' : An integer of the color of the shadow text of the label.
===font===
===font===
This is equivalent to [[dgsDxGUISetFont]]/[[dgsDxGUIGetFont]]. ''Learn More [[dxDrawText]]''
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"font",font)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"font",font)</syntaxhighlight>
*'''font''' : A [[Element/DX_font|dx font element]] of the text font of the label.
*'''font''' : A [[Element/DX_font|dx font element]] of the text font of the label.


===wordbreak===
===wordbreak===
Whether the word-break is enabled or not. ''Learn More [[dxDrawText]]''
Whether the word-break is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"wordbreak",wordbreak)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"wordbreak",wordbreak)</syntaxhighlight>
*'''wordbreak''' : If set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line.
*'''wordbreak''' : If set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line.


===colorcoded===
===colorcoded===
Whether the color code is enabled or not. ''Learn More [[dxDrawText]]''
Whether the color code is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"colorcoded",colorcoded)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"colorcoded",colorcoded)</syntaxhighlight>
*'''colorcoded''' : Set to true to enable embedded #FFFFFF color codes.
*'''colorcoded''' : Set to true to enable embedded #FFFFFF color codes.


===clip===
===clip===
Whether the clip property is enabled or not. ''Learn More [[dxDrawText]]''
Whether the clip property is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"clip",clip)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"clip",clip)</syntaxhighlight>
*'''clip''' : If set to true, the parts of the text that don't fit within the bounding box will be cut off.
*'''clip''' : If set to true, the parts of the text that don't fit within the bounding box will be cut off.


===rightbottom===
===rightbottom===
Alignment of the text within the label
Alignment of the text within the label
<syntaxhighlight lang="lua">dgsDxGUISetProperty(label,"rightbottom",{alignX,alignY})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"rightbottom",{alignX,alignY})</syntaxhighlight>
*'''alignX''' : Horizontal alignment of the text within the label. Can be "left", "center" or "right".
*'''alignX''' : Horizontal alignment of the text within the label. Can be "left", "center" or "right".
*'''alignY''' : Vertical alignment of the text within the label. Can be "top", "center" or "bottom".
*'''alignY''' : Vertical alignment of the text within the label. Can be "top", "center" or "bottom".
==See Also==
==See Also==
{{DGSPROPERTIES}}
{{DGSPROPERTIES}}

Revision as of 14:44, 12 February 2018

DGS Properties is always used to change the gui style and make it more fantastic.

This page shows the properties of dgs-dxlabel that you could use.

Main Functions

Properties

text

This is equivalent to dgsSetText/dgsGetText.

dgsSetProperty(label,"text",text)
  • text : A string of the text of the label.

textcolor

The color which can be translated by tocolor of the text of the label.

dgsSetProperty(label,"textcolor",textcolor)
  • textcolor : An integer of the color of the text of the label.

textsize

The scale of the text of the label. Learn More dxDrawText

dgsSetProperty(label,"textsize",{scaleX,scaleY})
  • scaleX : A float of the 2D X scale of the text of the label.
  • scaleY : A float of the 2D Y scale of the text of the label.

shadow

The shadow text of the label.

dgsSetProperty(label,"shadow",{offsetX,offsetY,color})
  • offsetX : A float of the 2D X offset of the shadow text of the label.
  • offsetY : A float of the 2D Y offset of the shadow text of the label.
  • color : An integer of the color of the shadow text of the label.

font

This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(label,"font",font)

wordbreak

Whether the word-break is enabled or not. Learn More dxDrawText

dgsSetProperty(label,"wordbreak",wordbreak)
  • wordbreak : If set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line.

colorcoded

Whether the color code is enabled or not. Learn More dxDrawText

dgsSetProperty(label,"colorcoded",colorcoded)
  • colorcoded : Set to true to enable embedded #FFFFFF color codes.

clip

Whether the clip property is enabled or not. Learn More dxDrawText

dgsSetProperty(label,"clip",clip)
  • clip : If set to true, the parts of the text that don't fit within the bounding box will be cut off.

rightbottom

Alignment of the text within the label

dgsSetProperty(label,"rightbottom",{alignX,alignY})
  • alignX : Horizontal alignment of the text within the label. Can be "left", "center" or "right".
  • alignY : Vertical alignment of the text within the label. Can be "top", "center" or "bottom".

See Also

General Properties

Unique Properties For DGS Core Elements

Extra Properties For DGS Plugins