Dgs-dxtabpanel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 17: Line 17:
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"bgImage",bgImage)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"bgImage",bgImage)</syntaxhighlight>
*'''bgImage:''' A material element that serves as the background image of the tab panel (texture/shader/screen source/renderTarget).
*'''bgImage:''' A material element that serves as the background image of the tab panel (texture/shader/screen source/renderTarget).
===tabHeight===
This property determines the height of tab.
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"tabHeight",{tabHeight,relative})</syntaxhighlight>
*'''tabHeight:''' A number of the height of the tab.
*'''relative:''' A bool of the relative state of the tab height.


===font===
===font===
Line 36: Line 30:
**'''"center"''':
**'''"center"''':
**'''"right"''':
**'''"right"''':
===tabColor===
This property determines the color of all tab buttons if not specified by [[dgs-dxtab#tabColor|tabColor of tab]]. Different from '''bgColor'''
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"tabColor",{defaultColor,hoveringColor,selectedColor})</syntaxhighlight>
*'''defaultColor:''' An integer of the color of the normal tab button.
*'''hoveringColor:''' An integer of the color of the tab button which is hovered on.
*'''selectedColor:''' An integer of the color of the tab button which is selected.
===tabHeight===
This property determines the height of tab.
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"tabHeight",{tabHeight,relative})</syntaxhighlight>
*'''tabHeight:''' A number of the height of the tab.
*'''relative:''' A bool of the relative state of the tab height.
===tabImage===
This property determines the image of all tab buttons if not specified by [[dgs-dxtab#tabImage|tabImage of tab]]. Different from '''bgImage'''
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"tabImage",{defaultImage,hoveringImage,selectedImage})</syntaxhighlight>
*'''defaultImage:''' A material element of the normal tab button. ( Passing a nil value can disable this option )
*'''hoveringImage:''' A material element of the tab button which is hovered on. ( Passing a nil value can disable this option )
*'''selectedImage:''' A material element of the tab button which is selected. ( Passing a nil value can disable this option )


===tabOffset===
===tabOffset===
Line 89: Line 103:
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"selected",selected)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"selected",selected)</syntaxhighlight>
*'''selected:''' A number of the index of selected tab.
*'''selected:''' A number of the index of selected tab.
===shadow===
The shadow text of the tab if not specified by tab.
<syntaxhighlight lang="lua">dgsSetProperty(tabpanel,"shadow",{offsetX,offsetY,color})</syntaxhighlight>
*'''offsetX:''' A float of the 2D X offset of the shadow text of the tab.
*'''offsetY:''' A float of the 2D Y offset of the shadow text of the tab.
*'''color:''' An integer of the color of the shadow text of the tab.


===renderTarget===
===renderTarget===

Latest revision as of 09:56, 7 May 2022

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

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

Main Functions

Properties

bgColor

This property determines the default background color of the tab panel.

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

bgImage

This property determines the default background image of the tab panel.

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

font

This property determines the default font of tabs. This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(tabpanel,"font",font)
  • font: A dx font element of the default text font of the tab panel.

tabAlignment

This property determines the alignment of all tabs.

dgsSetProperty(tabpanel,"tabAlignment",tabAlignment)
  • tabAlignment: A string determines the alignment of all tabs (NOT The Text Alignment). Available values are as follows:
    • "left":
    • "center":
    • "right":

tabColor

This property determines the color of all tab buttons if not specified by tabColor of tab. Different from bgColor

dgsSetProperty(tabpanel,"tabColor",{defaultColor,hoveringColor,selectedColor})
  • defaultColor: An integer of the color of the normal tab button.
  • hoveringColor: An integer of the color of the tab button which is hovered on.
  • selectedColor: An integer of the color of the tab button which is selected.

tabHeight

This property determines the height of tab.

dgsSetProperty(tabpanel,"tabHeight",{tabHeight,relative})
  • tabHeight: A number of the height of the tab.
  • relative: A bool of the relative state of the tab height.

tabImage

This property determines the image of all tab buttons if not specified by tabImage of tab. Different from bgImage

dgsSetProperty(tabpanel,"tabImage",{defaultImage,hoveringImage,selectedImage})
  • defaultImage: A material element of the normal tab button. ( Passing a nil value can disable this option )
  • hoveringImage: A material element of the tab button which is hovered on. ( Passing a nil value can disable this option )
  • selectedImage: A material element of the tab button which is selected. ( Passing a nil value can disable this option )

tabOffset

This property determines the offset of all tabs.

dgsSetProperty(tabpanel,"tabOffset",{tabOffset,relative})
  • tabOffset: An number of the offset of all tabs.
  • relative: A bool of the relative state of all tabs' offset.

tabPadding

This property determines the distance between the horizontal border of tabs to its text's bounding box.

dgsSetProperty(tabpanel,"tabPadding",{tabPadding,relative})
  • tabPadding: An number of the padding of the tab.
  • relative: A bool of the relative state of the tab padding.

tabGapSize

This property determines the distance between two tabs.

dgsSetProperty(tabpanel,"tabGapSize",{tabGapSize,relative})
  • tabGapSize: An number of distance between two tabs.
  • relative: A bool of the relative state of the tab gap size.

tabLengthAll

This property stores the length of all tabs (You may crash tab panel if you modify this property).

dgsSetProperty(tabpanel,"tabLengthAll",tabLengthAll)
  • tabLengthAll: A integer of the length of all tabs in pixels.

showPos

This property stores the value of how many pixels does the tabs scroll to left.

dgsSetProperty(tabpanel,"showPos",showPos)
  • showPos: A integer of how many pixels does the tabs scroll to left.

scrollSpeed

If you created a lot of tabs in tab panel, you can scroll your wheel on the tabs to view the tabs that are out of range.

This property determines the scroll speed.

dgsSetProperty(tabpanel,"scrollSpeed",{scrollSpeed,relative})
  • scrollSpeed: A number of scroll speed depends on relative.
  • relative: A bool of the relative state of the scrollSpeed.[false: pixels/scroll,true: ratio/scroll]

tabMaxWidth

This property restricts the maximum width of the tab.

dgsSetProperty(tabpanel,"tabMaxWidth",{tabMaxWidth,relative})
  • tabMaxWidth: A number of the maximum width of the tab.
  • relative: A bool of the relative state of the tabMaxWidth.

tabMinWidth

This property restricts the minimum width of the tab.

dgsSetProperty(tabpanel,"tabMinWidth",{tabMinWidth,relative})
  • tabMinWidth: A number of the minimum width of the tab.
  • relative: A bool of the relative state of the tabMinWidth.

selected

This property stores the index of selected tab.

dgsSetProperty(tabpanel,"selected",selected)
  • selected: A number of the index of selected tab.

shadow

The shadow text of the tab if not specified by tab.

dgsSetProperty(tabpanel,"shadow",{offsetX,offsetY,color})
  • offsetX: A float of the 2D X offset of the shadow text of the tab.
  • offsetY: A float of the 2D Y offset of the shadow text of the tab.
  • color: An integer of the color of the shadow text of the tab.

renderTarget

This property stores the render target that is used to render the tab button.

dgsSetProperty(tabpanel,"renderTarget",renderTarget)
  • renderTarget: A render target.

preSelect

This property stores the index of the tab which your mouse is hovering on.

dgsSetProperty(tabpanel,"preSelect",preSelect)
  • preSelect: A number of the index of the tab which your mouse is hovering on.

See Also

General Properties

Unique Properties For DGS Core Elements

Extra Properties For DGS Plugins