Dgs-dxbutton: Difference between revisions
Jump to navigation
Jump to search
(→font) |
|||
Line 47: | Line 47: | ||
This is equivalent to [[dgsDxGUISetFont]]/[[dgsDxGUIGetFont]]. ''Learn More [[dxDrawText]]'' | This is equivalent to [[dgsDxGUISetFont]]/[[dgsDxGUIGetFont]]. ''Learn More [[dxDrawText]]'' | ||
<syntaxhighlight lang="lua">dgsDxGUISetProperty(button,"font",font)</syntaxhighlight> | <syntaxhighlight lang="lua">dgsDxGUISetProperty(button,"font",font)</syntaxhighlight> | ||
*'''font''' : A [[Element/DX_font|dx font element]] of the text of the button. | *'''font''' : A [[Element/DX_font|dx font element]] of the text font of the button. | ||
===clickoffset=== | ===clickoffset=== | ||
===clickType=== | ===clickType=== |
Revision as of 13:19, 9 September 2017
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.
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 npr clicked by mouse ). ( You can pass a nil value to disable this image option )
- selimg: 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
Require integer that can be used as the background color of 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 ).
- selcolor: 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 of the text of the button which can be translated by tocolor.
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.