Dgs-dxswitchbutton

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

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

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