Dgs-dxselector

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-dxselector that you could use.

Main Functions

Properties

alignment

Alignment of the text within the selector.

The functions as follows are based on this property.

dgsSelectorSetHorizontalAlign/dgsSelectorGetHorizontalAlign

dgsSelectorSetVerticalAlign/dgsSelectorGetVerticalAlign

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

clip

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

dgsSetProperty(selector,"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(selector,"colorcoded",colorcoded)
  • colorcoded: Set to true to enable embedded #FFFFFF color codes.

enableScroll

Enable/disable mouse wheel scroll items.

dgsSetProperty(selector,"enableScroll",enableScroll)
  • enableScroll: A bool indicates whether to enable wheel scrolling on selector.

font

This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(selector,"font",font)

itemData

This property stores item data.

dgsSetProperty(selector,"itemData",itemData)
  • itemData: A table stores all item data.

Data Structure:

{
	{text,alignment,color,colorcoded,sizex,sizey,font,translationTest,data,imageData},
	{text,alignment,color,colorcoded,sizex,sizey,font,translationTest,data,imageData},
	{text,alignment,color,colorcoded,sizex,sizey,font,translationTest,data,imageData},
}

itemTextColor

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

dgsSetProperty(selector,"itemTextColor",itemTextColor)
  • itemTextColor: An integer of the color of the text of the selector.

itemTextSize

The scale of the item text of the selector. Learn More dxDrawText

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

placeHolder

This property determines what text will be when there's no items in selector

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

select

This property stores the selected item of the selector.

dgsSetProperty(selector,"select",select)
  • select: A integer of the index of selected item .

selectorSize

This property determines the size of selector button.

dgsSetProperty(selector,"selectorSize",{selectorSizeX,selectorSizeY,relative})
  • selectorSizeX: A float of the 2D X size of selector button, set to nil to use selectorSizeY.
  • selectorSizeY: A float of the 2D Y size of selector button, set to nil to use selectorSizeX.
  • relative: A bool of whether the selectorSize is relative to the size of selector or absolute pixels.

selectorText

The text of selector button of the selector.

dgsSetProperty(selector,"selectorText",{selectorTextLeft,selectorTextRight})
  • selectorTextLeft: A string of the text of left selector button of the selector.
  • selectorTextRight: A string of the text of right selector button of the selector.

selectorTextColor

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

dgsSetProperty(selector,"selectorTextColor",{normalColor,hoveringColor,clickedColor})
  • normalColor: An integer of the color of the text of selector button of the selector ( neither hovering nor clicked by mouse ).
  • hoveringColor: An integer of the color of the text of selector button of the selector which is hovering.
  • clickedColor: An integer of the color of the text of selector button of the selector which is clicked.

selectorTextSize

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

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

shadow

The shadow text of the selector.

dgsSetProperty(selector,"shadow",{offsetX,offsetY,color,outline})
  • offsetX: A float of the 2D X offset of the shadow text of the selector.
  • offsetY: A float of the 2D Y offset of the shadow text of the selector.
  • color: An integer of the color of the shadow text of the selector.
  • 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 disable. Learn More dxDrawText

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

If you are using dgs animation library, you'd better turn this on.

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

text

This is equivalent to dgsSetText/dgsGetText.

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

textColor

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

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

textSize

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

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

See Also

General Properties

Unique Properties