Dgs-dxedit: Difference between revisions

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


==Properties==
==Properties==
===alignment===
Alignment of the text within the edit.
The functions as follows are basic on this property.
[[dgsEditSetHorizontalAlign]]/[[dgsEditGetHorizontalAlign]]
[[dgsEditSetVerticalAlign]]/[[dgsEditGetVerticalAlign]]
<syntaxhighlight lang="lua">dgsSetProperty(edit,"alignment",{alignX,alignY})</syntaxhighlight>
*'''alignX''' : Horizontal alignment of the text within the edit. Can be "left", "center" or "right".
*'''alignY''' : Vertical alignment of the text within the edit. Can be "top", "center" or "bottom".
===allowCopy===
This propertry determines whether the text can be copyed ( ctrl+c ) or cut ( ctrl+x )
<syntaxhighlight lang="lua">dgsSetProperty(edit,"allowCopy",allowCopy)</syntaxhighlight>
*'''allowCopy''' : A bool indicates whjether the text can be copyed ( ctrl+c ) or cut ( ctrl+x )
===bgColor===
===bgColor===
This property determines the background color of the edit.
This property determines the background color of the edit.
Line 17: Line 34:
<syntaxhighlight lang="lua">dgsSetProperty(edit,"bgImage",bgImage)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"bgImage",bgImage)</syntaxhighlight>
*'''bgImage''' : A material element that serves as the background image of the edit (texture/shader/screen source/renderTarget).
*'''bgImage''' : A material element that serves as the background image of the edit (texture/shader/screen source/renderTarget).
===caretColor===
This property determines the color of the caret
<syntaxhighlight lang="lua">dgsSetProperty(edit,"caretColor",caretColor)</syntaxhighlight>
*'''caretColor''' : An integer of the color that can be converted by [[tocolor]].
===caretHeight===
This property determines what's the height of the caret.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"caretHeight",caretHeight)</syntaxhighlight>
*'''caretHeight''' : A bool indicates what's the height of the caret.
===caretOffset===
The offset of the caret of the edit.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"caretOffset",{offsetX,offsetY})</syntaxhighlight>
*'''offsetX''' : A float of the 2D X position offset of the caret of the edit.
*'''offsetY''' : A float of the 2D Y position offset of the caret of the edit.


===caretPos===
===caretPos===
Line 23: Line 56:
*'''index''' : An integer of the index of the text that the caret stays.
*'''index''' : An integer of the index of the text that the caret stays.


===text===
===clearSelection===
This is equivalent to [[dgsSetText]]/[[dgsGetText]].
This property determines whether the text selection will be cleared when the edit blurs.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"text",text)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"clearSelection",clearSelection)</syntaxhighlight>
*'''text''' : A ''table'' of the text of the edit.( Because of multi lines, I use table instead of string )
*'''clearSelection''' : A bool indicates whether the text selection will be cleared when the edit blurs.
 
===maxLength===
This is equivalent to [[dgsEditGetMaxLength]]/[[dgsEditSetMaxLength]]
<syntaxhighlight lang="lua">dgsSetProperty(edit,"maxLength",maxLength)</syntaxhighlight>
*'''maxLength''' : An integer indicating the maximum number of characters that can be typed into the edit box.
 
===textColor===
The color which can be translated by [[tocolor]] of the text of the edit.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"textColor",textColor)</syntaxhighlight>
*'''textColor''' : An integer of the color of the text of the edit.
 
===textSize===
The scale of the text of the edit. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(edit,"textSize",{scaleX,scaleY})</syntaxhighlight>
*'''scaleX''' : A float of the 2D X scale of the text of the edit.
*'''scaleY''' : A float of the 2D Y scale of the text of the edit.
 
===masked===
This is equivalent to [[dgsEditSetMasked]]/[[dgsEditGetMasked]]
<syntaxhighlight lang="lua">dgsSetProperty(edit,"masked",masked)</syntaxhighlight>
*'''masked''' : A boolean value indicating whether masking is to be enabled or disabled.
 
===maskText===
This property determines what the masked text will be, and the default is "*".
<syntaxhighlight lang="lua">dgsSetProperty(edit,"maskText",maskText)</syntaxhighlight>
*'''maskText''' : A string that the masked text will be.
 
===selectFrom===
The position from which the text is selected.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"selectFrom",{index,line})</syntaxhighlight>
*'''index''' : An integer of the index of the text that selected from.
 
===font===
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(edit,"font",font)</syntaxhighlight>
*'''font''' : A [[Element/DX_font|dx font element]] of the text font of the edit.
 
===showPos===
The min value of the x position of the text of the edit starts to show in the render target. ( I don't know how to explain it. XD )
<syntaxhighlight lang="lua">dgsSetProperty(edit,"showPos",posX)</syntaxhighlight>
*'''posX''' : An integer indicates how many pixels of the text are moved to left.


===caretStyle===
===caretStyle===
Line 89: Line 81:
*'''caretThick''' : An integer of the thickness of the caret of the edit.
*'''caretThick''' : An integer of the thickness of the caret of the edit.


===caretOffset===
===edit===
The offset of the caret of the edit.
This property stores a gui-edit which is used to input characters.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"caretOffset",{offsetX,offsetY})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"edit",gedit)</syntaxhighlight>
*'''offsetX''' : A float of the 2D X position offset of the caret of the edit.
*'''gedit''' : A gui-edit.
*'''offsetY''' : A float of the 2D Y position offset of the caret of the edit.
 
===enableTabSwitch===
This property determines whether we can use the key "tab" to switch to another edit.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"enableTabSwitch",enableTabSwitch)</syntaxhighlight>
*'''enableTabSwitch''' : A bool indicates whether we can use the key ''tab'' to switch to another edit.
 
===font===
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(edit,"font",font)</syntaxhighlight>
*'''font''' : A [[Element/DX_font|dx font element]] of the text font of the edit.
 
===masked===
This is equivalent to [[dgsEditSetMasked]]/[[dgsEditGetMasked]]
<syntaxhighlight lang="lua">dgsSetProperty(edit,"masked",masked)</syntaxhighlight>
*'''masked''' : A boolean value indicating whether masking is to be enabled or disabled.
 
===maskText===
This property determines what the masked text will be, and the default is "*".
<syntaxhighlight lang="lua">dgsSetProperty(edit,"maskText",maskText)</syntaxhighlight>
*'''maskText''' : A string that the masked text will be.
 
===maxLength===
This is equivalent to [[dgsEditGetMaxLength]]/[[dgsEditSetMaxLength]]
<syntaxhighlight lang="lua">dgsSetProperty(edit,"maxLength",maxLength)</syntaxhighlight>
*'''maxLength''' : An integer indicating the maximum number of characters that can be typed into the edit box.


===caretColor===
===padding===
This property determines the color of the caret
This property determines the padding of the text.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"caretColor",caretColor)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"padding",{paddingX,paddingY})</syntaxhighlight>
*'''caretColor''' : An integer of the color that can be converted by [[tocolor]].
*'''paddingX''' : An integer of 2D x padding value.
*'''paddingY''' : An integer of 2D y padding value.


===readOnly===
===readOnly===
Line 109: Line 126:
<syntaxhighlight lang="lua">dgsSetProperty(edit,"readOnlyCaretShow",readOnlyCaretShow)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"readOnlyCaretShow",readOnlyCaretShow)</syntaxhighlight>
*'''readOnlyCaretShow''' : A bool indicates whether the caret is shown or hidden when the edit is read-only.
*'''readOnlyCaretShow''' : A bool indicates whether the caret is shown or hidden when the edit is read-only.
===selectColor===
The color which can be translated by [[tocolor]] of the rectangle of test selection of the edit.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"selectColor",selectColor)</syntaxhighlight>
*'''selectColor''' : An integer of the color of the rectangle of test selection of the edit.
===padding===
This property determines the padding of the text.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"padding",{paddingX,paddingY})</syntaxhighlight>
*'''paddingX''' : An integer of 2D x padding value.
*'''paddingY''' : An integer of 2D y padding value.
===edit===
This property stores a gui-edit which is used to input characters.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"edit",gedit)</syntaxhighlight>
*'''gedit''' : A gui-edit.


===renderTarget===
===renderTarget===
Line 131: Line 132:
*'''renderTarget''' : A render target that is used to render the text.
*'''renderTarget''' : A render target that is used to render the text.


===enableTabSwitch===
===selectColor===
This property determines whether we can use the key "tab" to switch to another edit.
The color which can be translated by [[tocolor]] of the rectangle of test selection of the edit.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"enableTabSwitch",enableTabSwitch)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"selectColor",selectColor)</syntaxhighlight>
*'''enableTabSwitch''' : A bool indicates whether we can use the key ''tab'' to switch to another edit.
*'''selectColor''' : An integer of the color of the rectangle of test selection of the edit.


===clearSelection===
===selectFrom===
This property determines whether the text selection will be cleared when the edit blurs.
The position from which the text is selected.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"clearSelection",clearSelection)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"selectFrom",{index,line})</syntaxhighlight>
*'''clearSelection''' : A bool indicates whether the text selection will be cleared when the edit blurs.
*'''index''' : An integer of the index of the text that selected from.


===caretHeight===
===showPos===
This property determines what's the height of the caret.
The min value of the x position of the text of the edit starts to show in the render target. ( I don't know how to explain it. XD )
<syntaxhighlight lang="lua">dgsSetProperty(edit,"caretHeight",caretHeight)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"showPos",posX)</syntaxhighlight>
*'''caretHeight''' : A bool indicates what's the height of the caret.
*'''posX''' : An integer indicates how many pixels of the text are moved to left.


===alignment===
===text===
Alignment of the text within the edit.
This is equivalent to [[dgsSetText]]/[[dgsGetText]].
<syntaxhighlight lang="lua">dgsSetProperty(edit,"text",text)</syntaxhighlight>
*'''text''' : A ''table'' of the text of the edit.( Because of multi lines, I use table instead of string )


The functions as follows are basic on this property.
===textColor===
The color which can be translated by [[tocolor]] of the text of the edit.
<syntaxhighlight lang="lua">dgsSetProperty(edit,"textColor",textColor)</syntaxhighlight>
*'''textColor''' : An integer of the color of the text of the edit.


[[dgsEditSetHorizontalAlign]]/[[dgsEditGetHorizontalAlign]]
===textSize===
 
The scale of the text of the edit. ''Learn More [[dxDrawText]]''
[[dgsEditSetVerticalAlign]]/[[dgsEditGetVerticalAlign]]
<syntaxhighlight lang="lua">dgsSetProperty(edit,"textSize",{scaleX,scaleY})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(edit,"alignment",{alignX,alignY})</syntaxhighlight>
*'''scaleX''' : A float of the 2D X scale of the text of the edit.
*'''alignX''' : Horizontal alignment of the text within the edit. Can be "left", "center" or "right".
*'''scaleY''' : A float of the 2D Y scale of the text of the edit.
*'''alignY''' : Vertical alignment of the text within the edit. Can be "top", "center" or "bottom".
 
===allowCopy===
This propertry determines whether the text can be copyed ( ctrl+c ) or cut ( ctrl+x )
<syntaxhighlight lang="lua">dgsSetProperty(edit,"allowCopy",allowCopy)</syntaxhighlight>
*'''allowCopy''' : A bool indicates whjether the text can be copyed ( ctrl+c ) or cut ( ctrl+x )


===typingSound===
===typingSound===

Revision as of 17:13, 14 February 2019

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

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

Main Functions

Properties

alignment

Alignment of the text within the edit.

The functions as follows are basic on this property.

dgsEditSetHorizontalAlign/dgsEditGetHorizontalAlign

dgsEditSetVerticalAlign/dgsEditGetVerticalAlign

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

allowCopy

This propertry determines whether the text can be copyed ( ctrl+c ) or cut ( ctrl+x )

dgsSetProperty(edit,"allowCopy",allowCopy)
  • allowCopy : A bool indicates whjether the text can be copyed ( ctrl+c ) or cut ( ctrl+x )

bgColor

This property determines the background color of the edit.

dgsSetProperty(edit,"bgColor",bgColor)
  • bgColor : An integer of the color that can be converted by tocolor.

bgImage

This property determines the background image of the edit.

dgsSetProperty(edit,"bgImage",bgImage)
  • bgImage : A material element that serves as the background image of the edit (texture/shader/screen source/renderTarget).

caretColor

This property determines the color of the caret

dgsSetProperty(edit,"caretColor",caretColor)
  • caretColor : An integer of the color that can be converted by tocolor.

caretHeight

This property determines what's the height of the caret.

dgsSetProperty(edit,"caretHeight",caretHeight)
  • caretHeight : A bool indicates what's the height of the caret.

caretOffset

The offset of the caret of the edit.

dgsSetProperty(edit,"caretOffset",{offsetX,offsetY})
  • offsetX : A float of the 2D X position offset of the caret of the edit.
  • offsetY : A float of the 2D Y position offset of the caret of the edit.

caretPos

The position where the caret stays.

dgsSetProperty(edit,"caretPos",index)
  • index : An integer of the index of the text that the caret stays.

clearSelection

This property determines whether the text selection will be cleared when the edit blurs.

dgsSetProperty(edit,"clearSelection",clearSelection)
  • clearSelection : A bool indicates whether the text selection will be cleared when the edit blurs.

caretStyle

This is equivalent to dgsEditSetCaretStyle/dgsEditGetCaretStyle.

This property allows us to change the style of caret of the edit. ( 0 is "|"; 1 is "_" )

Example(0):

This is Text|

Example(1):

This is Text_

dgsSetProperty(edit,"caretStyle",caretStyle)
  • cursorStyle : An integer of the caret style of the edit.

caretThick

This property allows us to change the thickness of caret of the edit.

dgsSetProperty(edit,"caretThick",caretThick)
  • caretThick : An integer of the thickness of the caret of the edit.

edit

This property stores a gui-edit which is used to input characters.

dgsSetProperty(edit,"edit",gedit)
  • gedit : A gui-edit.

enableTabSwitch

This property determines whether we can use the key "tab" to switch to another edit.

dgsSetProperty(edit,"enableTabSwitch",enableTabSwitch)
  • enableTabSwitch : A bool indicates whether we can use the key tab to switch to another edit.

font

This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(edit,"font",font)

masked

This is equivalent to dgsEditSetMasked/dgsEditGetMasked

dgsSetProperty(edit,"masked",masked)
  • masked : A boolean value indicating whether masking is to be enabled or disabled.

maskText

This property determines what the masked text will be, and the default is "*".

dgsSetProperty(edit,"maskText",maskText)
  • maskText : A string that the masked text will be.

maxLength

This is equivalent to dgsEditGetMaxLength/dgsEditSetMaxLength

dgsSetProperty(edit,"maxLength",maxLength)
  • maxLength : An integer indicating the maximum number of characters that can be typed into the edit box.

padding

This property determines the padding of the text.

dgsSetProperty(edit,"padding",{paddingX,paddingY})
  • paddingX : An integer of 2D x padding value.
  • paddingY : An integer of 2D y padding value.

readOnly

This is equivalent to dgsEditSetReadOnly/dgsEditGetReadOnly.

dgsSetProperty(edit,"readOnly",readOnly)
  • readOnly : A bool indicates whether the edit is only readable.

readOnlyCaretShow

Whether the caret of edit will show/hide under read-only mode.

dgsSetProperty(edit,"readOnlyCaretShow",readOnlyCaretShow)
  • readOnlyCaretShow : A bool indicates whether the caret is shown or hidden when the edit is read-only.

renderTarget

This property stores a render target of the edit.

dgsSetProperty(edit,"renderTarget",renderTarget)
  • renderTarget : A render target that is used to render the text.

selectColor

The color which can be translated by tocolor of the rectangle of test selection of the edit.

dgsSetProperty(edit,"selectColor",selectColor)
  • selectColor : An integer of the color of the rectangle of test selection of the edit.

selectFrom

The position from which the text is selected.

dgsSetProperty(edit,"selectFrom",{index,line})
  • index : An integer of the index of the text that selected from.

showPos

The min value of the x position of the text of the edit starts to show in the render target. ( I don't know how to explain it. XD )

dgsSetProperty(edit,"showPos",posX)
  • posX : An integer indicates how many pixels of the text are moved to left.

text

This is equivalent to dgsSetText/dgsGetText.

dgsSetProperty(edit,"text",text)
  • text : A table of the text of the edit.( Because of multi lines, I use table instead of string )

textColor

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

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

textSize

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

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

typingSound

Typing sound, nil for disabled. This is equivalent to dgsEditSetTypingSound/dgsEditGetTypingSound

dgsSetProperty(edit,"typingSound",typingSound)
  • typingSound: A string of the path/url of typing sound.

See Also

General Properties

Unique Properties For DGS Core Elements

Extra Properties For DGS Plugins