Dgs-dxswitchbutton: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Blanked the page)
Tag: Blanking
No edit summary
Line 1: Line 1:
[[Dgs|DGS]] Properties is always used to change the gui style and make it more fantastic.


This page shows the properties of dgs-dxswitchbutton that you could use.
==Main Functions==
*[[dgsSetProperty]]
*[[dgsGetProperty]]
==Properties==
===alignment===
Alignment of the text within the switch button.
The functions as follows are basic on this property.
[[dgsSwitchButtonSetHorizontalAlign]]/[[dgsSwitchButtonGetHorizontalAlign]]
[[dgsSwitchButtonSetVerticalAlign]]/[[dgsSwitchButtonGetVerticalAlign]]
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"alignment",{alignX,alignY})</syntaxhighlight>
*'''alignX:''' Horizontal alignment of the text within the switch button. Can be "left", "center" or "right".
*'''alignY:''' Vertical alignment of the text within the switch button. Can be "top", "center" or "bottom".
===clickType===
This property determines which button on mouse can change the state of switch button.
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"clickType",clickType)</syntaxhighlight>
*'''clickType:''' An integer, available values are as follows:
**'''1:''' Left Mouse Button
**'''2:''' Wheel
**'''3:''' Right Mouse Button
===clip===
Whether the clip property is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"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.
===cursorMoveSpeed===
This property determines the cursor moving speed when switch button changes state.
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"cursorMoveSpeed",cursorMoveSpeed)</syntaxhighlight>
*'''cursorMoveSpeed:''' A float of the cursor moving speed when switch button changes state.
===cursorWidth===
This property determines the cursor width of switch button.
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"cursorWidth",cursorWidth)</syntaxhighlight>
*'''cursorWidth:''' A float of the cursor width of switch button.
===colorcoded===
Whether the color code is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"colorcoded",colorcoded)</syntaxhighlight>
*'''colorcoded:''' Set to true to enable embedded #FFFFFF color codes.
===font===
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"font",font)</syntaxhighlight>
*'''font:''' A string or a [[Element/DX_font|dx font element]] of the text font of the switch button.
===shadow===
The shadow text of the switch button.
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"shadow",{offsetX,offsetY,color,outline})</syntaxhighlight>
*'''offsetX:''' A float of the 2D X offset of the shadow text of the switch button.
*'''offsetY:''' A float of the 2D Y offset of the shadow text of the switch button.
*'''color:''' An integer of the color of the shadow text of the switch button.
*'''outline:''' A bool of the outline state of the shadow text.
===state===
This property indicates the state of switch button.
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"state",state)</syntaxhighlight>
*'''state:''' A bool indicates the state of switch button.
**'''true:''' Turns on
**'''false:''' Turns off
===stateAnim===
This stores the progress of cursor animation, which is not recommend to modify.
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"stateAnim",stateAnim)</syntaxhighlight>
*'''stateAnim:''' A float of the cursor animation progress.
===textOn===
This property stores the text to be shown when the switch button turns on.(State=true)
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"textOn",textOn)</syntaxhighlight>
*'''textOn:''' A string of the text of the switch button.
===textOff===
This property stores the text to be shown when the switch button turns off.(State=false)
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"textOff",textOff)</syntaxhighlight>
*'''textOff:''' A string of the text of the switch button.
===textColor_t===
The color which can be translated by [[tocolor]] of the text when the switch button turns on.(State=true)
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"textColor_t",textColor_t)</syntaxhighlight>
*'''textColor_t:''' An integer of the color of the text when the switch button turns on.(State=true)
===textColor_f===
The color which can be translated by [[tocolor]] of the text when the switch button turns off.(State=false)
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"textColor_f",textColor_f)</syntaxhighlight>
*'''textColor_f:''' An integer of the color of the text when the switch button turns off.(State=false)
===textSize===
The scale of the text of the switch button. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"textSize",{scaleX,scaleY})</syntaxhighlight>
*'''scaleX:''' A float of the 2D X scale of the text of the switch button.
*'''scaleY:''' A float of the 2D Y scale of the text of the switch button.
===wordbreak===
Whether the word-break is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(switchButton,"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==
{{DGSPROPERTIES}}

Revision as of 09:22, 2 April 2020

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

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

Main Functions

Properties

alignment

Alignment of the text within the switch button.

The functions as follows are basic on this property.

dgsSwitchButtonSetHorizontalAlign/dgsSwitchButtonGetHorizontalAlign

dgsSwitchButtonSetVerticalAlign/dgsSwitchButtonGetVerticalAlign

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

clickType

This property determines which button on mouse can change the state of switch button.

dgsSetProperty(switchButton,"clickType",clickType)
  • clickType: An integer, available values are as follows:
    • 1: Left Mouse Button
    • 2: Wheel
    • 3: Right Mouse Button

clip

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

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

cursorMoveSpeed

This property determines the cursor moving speed when switch button changes state.

dgsSetProperty(switchButton,"cursorMoveSpeed",cursorMoveSpeed)
  • cursorMoveSpeed: A float of the cursor moving speed when switch button changes state.

cursorWidth

This property determines the cursor width of switch button.

dgsSetProperty(switchButton,"cursorWidth",cursorWidth)
  • cursorWidth: A float of the cursor width of switch button.

colorcoded

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

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

font

This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(switchButton,"font",font)

shadow

The shadow text of the switch button.

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

state

This property indicates the state of switch button.

dgsSetProperty(switchButton,"state",state)
  • state: A bool indicates the state of switch button.
    • true: Turns on
    • false: Turns off

stateAnim

This stores the progress of cursor animation, which is not recommend to modify.

dgsSetProperty(switchButton,"stateAnim",stateAnim)
  • stateAnim: A float of the cursor animation progress.

textOn

This property stores the text to be shown when the switch button turns on.(State=true)

dgsSetProperty(switchButton,"textOn",textOn)
  • textOn: A string of the text of the switch button.

textOff

This property stores the text to be shown when the switch button turns off.(State=false)

dgsSetProperty(switchButton,"textOff",textOff)
  • textOff: A string of the text of the switch button.

textColor_t

The color which can be translated by tocolor of the text when the switch button turns on.(State=true)

dgsSetProperty(switchButton,"textColor_t",textColor_t)
  • textColor_t: An integer of the color of the text when the switch button turns on.(State=true)

textColor_f

The color which can be translated by tocolor of the text when the switch button turns off.(State=false)

dgsSetProperty(switchButton,"textColor_f",textColor_f)
  • textColor_f: An integer of the color of the text when the switch button turns off.(State=false)

textSize

The scale of the text of the switch button. Learn More dxDrawText

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

wordbreak

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

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