Dgs-dxcheckbox: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 20: Line 20:
*'''alignY:''' Vertical alignment of the text within the checkbox. Can be "top", "center" or "bottom".
*'''alignY:''' Vertical alignment of the text within the checkbox. Can be "top", "center" or "bottom".


===image_f===
===clip===
This property determines the icon under 3 conditions when the check box is unchecked.
Whether the clip property is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"image_f",{ImageNormal,ImageHover,ImageClick})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"clip",clip)</syntaxhighlight>
*'''ImageNormal:''' An image element of the icon under normal state. (unchecked)
*'''clip:''' If set to true, the parts of the text that don't fit within the bounding box will be cut off.
*'''ImageHover:''' An image element of the icon under hovering state. (unchecked)
*'''ImageClick:''' An image element of the icon under clicked state. (unchecked)


===image_t===
===color_i===
This property determines the icon under 3 conditions when the check box is checked.
This property determines the color of the icon under 3 conditions when the check box is indeterminate.
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"image_t",{ImageNormal,ImageHover,ImageClick})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"color_i",{ColorNormal,ColorHover,ColorClick})</syntaxhighlight>
*'''ImageNormal:''' An image element of the icon under normal state. (checked)
*'''ColorNormal:''' An integer of the color of the icon under normal state. (indeterminate)
*'''ImageHover:''' An image element of the icon under hovering state. (checked)
*'''ColorHover:''' An integer of the color of the icon under hovering state. (indeterminate)
*'''ImageClick:''' An image element of the icon under clicked state. (checked)
*'''ColorClick:''' An integer of the color of the icon under clicked state. (indeterminate)
 
===image_i===
This property determines the icon under 3 conditions when the check box is indeterminate.
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"image_i",{ImageNormal,ImageHover,ImageClick})</syntaxhighlight>
*'''ImageNormal:''' An image element of the icon under normal state. (indeterminate)
*'''ImageHover:''' An image element of the icon under hovering state. (indeterminate)
*'''ImageClick:''' An image element of the icon under clicked state. (indeterminate)


===color_f===
===color_f===
Line 55: Line 46:
*'''ColorClick:''' An integer of the color of the icon under clicked state. (checked)
*'''ColorClick:''' An integer of the color of the icon under clicked state. (checked)


===color_i===
===colorcoded===
This property determines the color of the icon under 3 conditions when the check box is indeterminate.
Whether the color code is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"color_i",{ColorNormal,ColorHover,ColorClick})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"colorcoded",colorcoded)</syntaxhighlight>
*'''ColorNormal:''' An integer of the color of the icon under normal state. (indeterminate)
*'''colorcoded:''' Set to true to enable embedded #FFFFFF color codes.
*'''ColorHover:''' An integer of the color of the icon under hovering state. (indeterminate)
 
*'''ColorClick:''' An integer of the color of the icon under clicked state. (indeterminate)
===font===
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"font",font)</syntaxhighlight>
*'''font:''' A string or a [[Element/DX_font|dx font element]] of the text font of the checkbox.


===text===
===image_f===
This is equivalent to [[dgsSetText]]/[[dgsGetText]].
This property determines the icon under 3 conditions when the check box is unchecked.
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"text",text)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"image_f",{ImageNormal,ImageHover,ImageClick})</syntaxhighlight>
*'''text:''' A string of the text of the checkbox.
*'''ImageNormal:''' An image element of the icon under normal state. (unchecked)
*'''ImageHover:''' An image element of the icon under hovering state. (unchecked)
*'''ImageClick:''' An image element of the icon under clicked state. (unchecked)


===textColor===
===image_i===
The color which can be translated by [[tocolor]] of the text of the checkbox.
This property determines the icon under 3 conditions when the check box is indeterminate.
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"textColor",textColor)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"image_i",{ImageNormal,ImageHover,ImageClick})</syntaxhighlight>
*'''textColor:''' An integer of the color of the text of the checkbox.
*'''ImageNormal:''' An image element of the icon under normal state. (indeterminate)
*'''ImageHover:''' An image element of the icon under hovering state. (indeterminate)
*'''ImageClick:''' An image element of the icon under clicked state. (indeterminate)


===textSize===
===image_t===
The scale of the text of the checkbox. ''Learn More [[dxDrawText]]''
This property determines the icon under 3 conditions when the check box is checked.
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"textSize",{scaleX,scaleY})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"image_t",{ImageNormal,ImageHover,ImageClick})</syntaxhighlight>
*'''scaleX:''' A float of the 2D X scale of the text of the checkbox.
*'''ImageNormal:''' An image element of the icon under normal state. (checked)
*'''scaleY:''' A float of the 2D Y scale of the text of the checkbox.
*'''ImageHover:''' An image element of the icon under hovering state. (checked)
*'''ImageClick:''' An image element of the icon under clicked state. (checked)


===shadow===
===shadow===
Line 85: Line 84:
*'''color:''' An integer of the color of the shadow text of the checkbox.
*'''color:''' An integer of the color of the shadow text of the checkbox.
*'''outline:''' A bool of the outline state of the shadow text.
*'''outline:''' A bool of the outline state of the shadow text.
===font===
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"font",font)</syntaxhighlight>
*'''font:''' A string or a [[Element/DX_font|dx font element]] of the text font of the checkbox.
===wordbreak===
Whether the word-break is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"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.
===colorcoded===
Whether the color code is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"colorcoded",colorcoded)</syntaxhighlight>
*'''colorcoded:''' Set to true to enable embedded #FFFFFF color codes.
===clip===
Whether the clip property is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"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.


===state===
===state===
Line 113: Line 92:
**'''false:''' Unchecked
**'''false:''' Unchecked
**'''nil:''' indeterminate
**'''nil:''' indeterminate
===text===
This is equivalent to [[dgsSetText]]/[[dgsGetText]].
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"text",text)</syntaxhighlight>
*'''text:''' A string of the text of the checkbox.
===textColor===
The color which can be translated by [[tocolor]] of the text of the checkbox.
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"textColor",textColor)</syntaxhighlight>
*'''textColor:''' An integer of the color of the text of the checkbox.


===textImageSpace===
===textImageSpace===
Line 118: Line 107:
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"textImageSpace",textImageSpace)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"textImageSpace",textImageSpace)</syntaxhighlight>
*'''textImageSpace''' A float of the distance from the icon to the text of the check box.
*'''textImageSpace''' A float of the distance from the icon to the text of the check box.
===textSize===
The scale of the text of the checkbox. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"textSize",{scaleX,scaleY})</syntaxhighlight>
*'''scaleX:''' A float of the 2D X scale of the text of the checkbox.
*'''scaleY:''' A float of the 2D Y scale of the text of the checkbox.
===wordbreak===
Whether the word-break is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(checkbox,"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.


==See Also==
==See Also==
{{DGSPROPERTIES}}
{{DGSPROPERTIES}}

Revision as of 15:22, 1 October 2019

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

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

Main Functions

Properties

alignment

Alignment of the text within the checkbox.

The functions as follows are basic on this property.

dgsCheckBoxSetHorizontalAlign/dgsCheckBoxGetHorizontalAlign

dgsCheckBoxSetVerticalAlign/dgsCheckBoxGetVerticalAlign

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

clip

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

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

color_i

This property determines the color of the icon under 3 conditions when the check box is indeterminate.

dgsSetProperty(checkbox,"color_i",{ColorNormal,ColorHover,ColorClick})
  • ColorNormal: An integer of the color of the icon under normal state. (indeterminate)
  • ColorHover: An integer of the color of the icon under hovering state. (indeterminate)
  • ColorClick: An integer of the color of the icon under clicked state. (indeterminate)

color_f

This property determines the color of the icon under 3 conditions when the check box is unchecked.

dgsSetProperty(checkbox,"color_f",{ColorNormal,ColorHover,ColorClick})
  • ColorNormal: An integer of the color of the icon under normal state. (unchecked)
  • ColorHover: An integer of the color of the icon under hovering state. (unchecked)
  • ColorClick: An integer of the color of the icon under clicked state. (unchecked)

color_t

This property determines the color of the icon under 3 conditions when the check box is checked.

dgsSetProperty(checkbox,"color_t",{ColorNormal,ColorHover,ColorClick})
  • ColorNormal: An integer of the color of the icon under normal state. (checked)
  • ColorHover: An integer of the color of the icon under hovering state. (checked)
  • ColorClick: An integer of the color of the icon under clicked state. (checked)

colorcoded

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

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

font

This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(checkbox,"font",font)

image_f

This property determines the icon under 3 conditions when the check box is unchecked.

dgsSetProperty(checkbox,"image_f",{ImageNormal,ImageHover,ImageClick})
  • ImageNormal: An image element of the icon under normal state. (unchecked)
  • ImageHover: An image element of the icon under hovering state. (unchecked)
  • ImageClick: An image element of the icon under clicked state. (unchecked)

image_i

This property determines the icon under 3 conditions when the check box is indeterminate.

dgsSetProperty(checkbox,"image_i",{ImageNormal,ImageHover,ImageClick})
  • ImageNormal: An image element of the icon under normal state. (indeterminate)
  • ImageHover: An image element of the icon under hovering state. (indeterminate)
  • ImageClick: An image element of the icon under clicked state. (indeterminate)

image_t

This property determines the icon under 3 conditions when the check box is checked.

dgsSetProperty(checkbox,"image_t",{ImageNormal,ImageHover,ImageClick})
  • ImageNormal: An image element of the icon under normal state. (checked)
  • ImageHover: An image element of the icon under hovering state. (checked)
  • ImageClick: An image element of the icon under clicked state. (checked)

shadow

The shadow text of the checkbox.

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

state

This property stores the state of the check box.

dgsSetProperty(checkbox,"state",state)
  • state: A bool/nil of the state. Values can be as follows:
    • true: Checked
    • false: Unchecked
    • nil: indeterminate

text

This is equivalent to dgsSetText/dgsGetText.

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

textColor

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

dgsSetProperty(checkbox,"textColor",textColor)
  • textColor: An integer of the color of the text of the checkbox.

textImageSpace

This property determines the space between the text and icon.

dgsSetProperty(checkbox,"textImageSpace",textImageSpace)
  • textImageSpace A float of the distance from the icon to the text of the check box.

textSize

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

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

wordbreak

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

dgsSetProperty(checkbox,"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