DgsCreateComboBox: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 8: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
[[Image:Mta-screen_2017-08-11_07-43-55.jpg|frame|Example DGS ComboBox.]] | [[Image:Mta-screen_2017-08-11_07-43-55.jpg|frame|Example DGS ComboBox.]] | ||
*'''x:''' A float of the 2D x position of the | *'''x:''' A float of the 2D x position of the DGS combobox on a player's screen. This is affected by the ''relative'' argument. | ||
*'''y:''' A float of the 2D y position of the | *'''y:''' A float of the 2D y position of the DGS combobox on a player's screen. This is affected by the ''relative'' argument. | ||
*'''width:''' A float of the width of the | *'''width:''' A float of the width of the DGS combobox. This is affected by the ''relative'' argument. | ||
*'''height:''' A float of the height of the | *'''height:''' A float of the height of the DGS combobox. This is affected by the ''relative'' argument. Note: height must be enough to fit the drop down menu, else the drop down won't appear. | ||
*'''relative:''' This is whether sizes and positioning are relative. If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent. | *'''relative:''' This is whether sizes and positioning are relative. If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent. | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
*'''parent:''' This is the parent that the | *'''parent:''' This is the parent that the DGS combobox is attached to. | ||
*'''item height:''' It's the height of the itemes | *'''item height:''' It's the height of the itemes. | ||
*''' textcolor:''' It's the Text Color used. | *'''textcolor:''' It's the Text Color used. | ||
*''' scalex :''' It's the Text Scale X position. | *'''scalex :''' It's the Text Scale X position. | ||
*''' scaley :''' It's the Text Scale Y position. | *'''scaley :''' It's the Text Scale Y position. | ||
*''' | *'''defimg:''' A texture element of the background of the button of the combo box( no mouse enter and no mouse click ). | ||
*'''selimg:''' A texture element of the background of the button of the combo box which is selected. | |||
*'''cliimg:''' A texture element of the background of the button of the combo box which is clicked. | |||
*'''defcolor:''' An int of the color of the background of the button of the combo box ( no mouse enter and no mouse click ). | |||
*'''selcolor:''' An int of the color of the background of the button of the combo box which is selected. | |||
*'''clicolor:''' An int of the color of the background of the button of the combo box which is clicked. | |||
==Example== | ==Example== |
Revision as of 09:25, 11 August 2017
This function allows creation of a DGS ComboBox .
Syntax
element dgsDxCreateComboBox( float x, float y, float width, float height, bool relative, [ element parent = nil, element itemheight = 20, int textcolor = 0xFF000000, float scalex = 1, float scaley = 1, element defimg = nil, element selimg = nil, element cliimg = nil, int defcolor = 0x0078C8C8, int hovcolor= 0xC8005AFF, int clicolor = 0xC8325AFA] )
Required Arguments
- x: A float of the 2D x position of the DGS combobox on a player's screen. This is affected by the relative argument.
- y: A float of the 2D y position of the DGS combobox on a player's screen. This is affected by the relative argument.
- width: A float of the width of the DGS combobox. This is affected by the relative argument.
- height: A float of the height of the DGS combobox. This is affected by the relative argument. Note: height must be enough to fit the drop down menu, else the drop down won't appear.
- relative: This is whether sizes and positioning are relative. If this is true, then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent.
Optional Arguments
- parent: This is the parent that the DGS combobox is attached to.
- item height: It's the height of the itemes.
- textcolor: It's the Text Color used.
- scalex : It's the Text Scale X position.
- scaley : It's the Text Scale Y position.
- defimg: A texture element of the background of the button of the combo box( no mouse enter and no mouse click ).
- selimg: A texture element of the background of the button of the combo box which is selected.
- cliimg: A texture element of the background of the button of the combo box which is clicked.
- defcolor: An int of the color of the background of the button of the combo box ( no mouse enter and no mouse click ).
- selcolor: An int of the color of the background of the button of the combo box which is selected.
- clicolor: An int of the color of the background of the button of the combo box which is clicked.
Example
This example creates a combo box in the center of the screen.
DGS = exports.dgs addEventHandler("onClientResourceStart", resourceRoot, function() qiw = DGS:dgsDxCreateComboBox(0.29, 0.30, 0.44, 0.04, true) showCursor(true) end )
Example Create by :Ridden