Dgs-dxlabel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 45: Line 45:
===subPixelPositioning===
===subPixelPositioning===
This property determines whether the '''subPixelPositioning''' is enabled or not, by default, it is enabled. ''Learn More [[dxDrawText]]''
This property determines whether the '''subPixelPositioning''' is enabled or not, by default, it is enabled. ''Learn More [[dxDrawText]]''
'''subPixelPositioning''' Will make positioning and resizing animation looks better, but you should know, it may blurs your static text with unrounded position and size, or alignment.
'''subPixelPositioning''' Will make positioning and resizing animation looks better, but you should know, it may blurs your static text with unrounded position and size, or alignment.
<syntaxhighlight lang="lua">dgsSetProperty(label,"subPixelPositioning",subPixelPositioning)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(label,"subPixelPositioning",subPixelPositioning)</syntaxhighlight>

Revision as of 12:09, 30 April 2020

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

alignment

Alignment of the text within the label.

The functions as follows are basic on this property.

dgsLabelSetHorizontalAlign/dgsLabelGetHorizontalAlign

dgsLabelSetVerticalAlign/dgsLabelGetVerticalAlign

dgsSetProperty(label,"alignment",{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".

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.

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.

font

This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(label,"font",font)

shadow

The shadow text of the label.

dgsSetProperty(label,"shadow",{offsetX,offsetY,color,outline})
  • 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.
  • outline: A bool of the outline state of the shadow text.

subPixelPositioning

This property determines whether the subPixelPositioning is enabled or not, by default, it is enabled. Learn More dxDrawText

subPixelPositioning Will make positioning and resizing animation looks better, but you should know, it may blurs your static text with unrounded position and size, or alignment.

dgsSetProperty(label,"subPixelPositioning",subPixelPositioning)
  • subPixelPositioning: A bool indicates whether to enable subPixelPositioning or not.

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.

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.

See Also

General Properties

Unique Properties For DGS Core Elements

Extra Properties For DGS Plugins