Dgs-dxscrollpane: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 21: Line 21:


===bgImage===
===bgImage===
This property determines the background image of the scroll pane.
This property determines the background image of the scroll pane. '''Specify '[[Dgs-dxscrollpane#bgColor|bgColor]]' before using bgImage'''
<syntaxhighlight lang="lua">dgsSetProperty(scrollpane,"bgImage",bgImage)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(scrollpane,"bgImage",bgImage)</syntaxhighlight>
*'''bgImage:''' A material element that serves as the background image of the scroll pane (texture/shader/screen source/renderTarget).
*'''bgImage:''' A material element that serves as the background image of the scroll pane (texture/shader/screen source/renderTarget).
Line 37: Line 37:
*'''scrollHardness:''' A float determins how hard will the scroll pane moves when scrolling with wheel ( should be larger than 0, lower than 1 ).
*'''scrollHardness:''' A float determins how hard will the scroll pane moves when scrolling with wheel ( should be larger than 0, lower than 1 ).
*'''dragHardness:''' A float determins how hard will the scroll pane moves when dragging with mouse ( should be larger than 0, lower than 1 ).
*'''dragHardness:''' A float determins how hard will the scroll pane moves when dragging with mouse ( should be larger than 0, lower than 1 ).
===padding===
This property determines the content padding from 4 sides of element (left/top/right/bottom)
<syntaxhighlight lang="lua">dgsSetProperty(scrollpane, "padding", {horizontal, vertical, relative})</syntaxhighlight>
*'''horizontal:'''  A float of the horizontal padding in pixels.
*'''vertical:'''  A float of the vertical padding in pixels.


===scrollBarThick===
===scrollBarThick===

Latest revision as of 02:58, 18 March 2024

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

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

Main Functions

Properties

basePointOffset

This property changes the offset of the base point where x=0, y=0. And by default, base point offset is 0, 0.

dgsSetProperty(scrollpane,"basePointOffset",{offsetX ,offsetY,relative})
  • offsetX : A float of the 2D X offset relative to the position of the text of radio button, depends on relative.
  • offsetY: A float of the 2D Y offset relative to the position of the text of radio button, depends on relative.
  • relative: A bool of whether the offset is relative to the size of scroll pane or absolute pixels.

bgColor

This property determines the background color of the scroll pane.

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

bgImage

This property determines the background image of the scroll pane. Specify 'bgColor' before using bgImage

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

minViewSize

This property determines the minimal view size of scroll pane. By default, view size is determined by the content in the scroll pane.

dgsSetProperty(scrollpane,"minViewSize",{w,h,relative})
  • w: A float if the minimal view size in width.
  • h: A float if the minimal view size in height.
  • relative: A bool of whether the minimal view size is relative to the size of scroll pane or absolute pixels.

moveHardness

This property determines how hard will the scroll pane moves when scrolling.

dgsSetProperty(scrollpane,"moveHardness",{scrollHardness,dragHardness})
  • scrollHardness: A float determins how hard will the scroll pane moves when scrolling with wheel ( should be larger than 0, lower than 1 ).
  • dragHardness: A float determins how hard will the scroll pane moves when dragging with mouse ( should be larger than 0, lower than 1 ).

padding

This property determines the content padding from 4 sides of element (left/top/right/bottom)

dgsSetProperty(scrollpane, "padding", {horizontal, vertical, relative})
  • horizontal: A float of the horizontal padding in pixels.
  • vertical: A float of the vertical padding in pixels.

scrollBarThick

This property determines the thickness of scroll bar.

dgsSetProperty(scrollpane,"scrollBarThick",scrollBarThick)
  • scrollBarThick: An integer of the thickness of scroll bar.

scrollBarState

This property forces the visibility of scroll bar. See dgsScrollPaneSetScrollBarState/dgsScrollPaneGetScrollBarState

dgsSetProperty(scrollpane,"scrollBarState",{vertical,horizontal})
  • vertical: A bool of the state of the vertical scroll bar.
  • horizontal: A bool of the state of the horizontal scroll bar.
    • true: Force to be visible
    • false: Force to be invisible
    • nil: Auto

scrollBarLength

This property forces the length of the cursor of scroll bar to be static instead of being adjusted automatically.

dgsSetProperty(scrollpane,"scrollBarLength",{{VerticalLen,VerticalRelative},{HorizontalLen,HorizontalRelative}})
  • VerticalLen: A float of the cursor length of the vertical scroll bar.
  • VerticalRelative: A bool indicates whether the length is relative to the size of scroll bar or not.
  • HorizontalLen: A float of the cursor length of the horizontal scroll bar.
  • HorizontalRelative: A bool indicates whether the length is relative to the size of scroll bar or not.

See Also

General Properties

Unique Properties For DGS Core Elements

Extra Properties For DGS Plugins