Dgs-dxbutton: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[https://wiki.multitheftauto.com/wiki/Dgs|DGS] Properties is always used to change the gui style and make it more fantastic. | |||
This page shows the properties of dgs-dxbutton that you could use. | This page shows the properties of dgs-dxbutton that you could use. |
Revision as of 05:39, 16 December 2017
[1] Properties is always used to change the gui style and make it more fantastic.
This page shows the properties of dgs-dxbutton that you could use.
Main Functions
Properties
image
Require [texture/shader] that can be used as the background of button.
dgsDxGUISetProperty(button,"image",{defimg,hovimg,cliimg})
- defimg: A texture/shader element of the background of the button ( neither selected nor clicked by mouse ). ( You can pass a nil value to disable this image option )
- hovimg: A texture/shader element of the background of the button which is selected. ( You can pass a nil value to disable this image option )
- cliimg: A texture/shader element of the background of the button which is clicked. ( You can pass a nil value to disable this image option )
color
The color which can be translated by tocolor of the background of the button.
dgsDxGUISetProperty(button,"color",{defcolor,hovcolor,clicolor})
- defcolor: An integer of the color of the background of the button ( neither selected nor clicked by mouse ).
- hovcolor: An integer of the color of the background of the button which is selected.
- clicolor: An integer of the color of the background of the button which is clicked.
text
This is equivalent to dgsDxGUISetText/dgsDxGUIGetText.
dgsDxGUISetProperty(button,"text",text)
- text : A string of the text of the button.
textcolor
The color which can be translated by tocolor of the text of the button.
dgsDxGUISetProperty(button,"textcolor",textcolor)
- textcolor : An integer of the color of the text of the button.
textsize
The scale of the text of the button. Learn More dxDrawText
dgsDxGUISetProperty(button,"textsize",{scaleX,scaleY})
- scaleX : A float of the 2D X scale of the text of the button.
- scaleY : A float of the 2D Y scale of the text of the button.
shadow
The shadow text of the button.
dgsDxGUISetProperty(button,"shadow",{offsetX,offsetY,color})
- offsetX : A float of the 2D X offset of the shadow text of the button.
- offsetY : A float of the 2D Y offset of the shadow text of the button.
- color : An integer of the color of the shadow text of the button.
font
This is equivalent to dgsDxGUISetFont/dgsDxGUIGetFont. Learn More dxDrawText
dgsDxGUISetProperty(button,"font",font)
- font : A dx font element of the text font of the button.
clickoffset
The offset indicates that how much the text of the button will shift when it is clicked.
dgsDxGUISetProperty(button,"clickoffset",{offsetX,offsetY})
- offsetX : A float of the 2D X offset relative to the position of the button.
- offsetY : A float of the 2D Y offset relative to the position of the button.
clickType
This indicates that which button of the mouse can have effect on the button.
dgsDxGUISetProperty(button,"clickType",clickType)
- clickType : If set to 1, only "Left Mouse Button" can do. If set to 2, only "Right Mouse Button" can do. Otherwise it will be both.
wordbreak
Whether the word-break is enabled or not. Learn More dxDrawText
dgsDxGUISetProperty(button,"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.
colorcoded
Whether the color code is enabled or not. Learn More dxDrawText
dgsDxGUISetProperty(button,"colorcoded",colorcoded)
- colorcoded : Set to true to enable embedded #FFFFFF color codes.
rightbottom
Alignment of the text within the button
dgsDxGUISetProperty(button,"rightbottom",{alignX,alignY})
- alignX : Horizontal alignment of the text within the button. Can be "left", "center" or "right".
- alignY : Vertical alignment of the text within the button. Can be "top", "center" or "bottom".