DxButton: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
|  (Created page with "__NOTOC__  {{Client function}} This function allows creation of a Modern DX Library Button, which is a clickable item as part of GUI.  '''Notice: This is a function exported by Modern DX Library!'''  ==Syntax==  <syntaxhighlight lang="lua"> element dxButton( float x, float y, float width, float height, string text [, element parent = nil, bool rounded = nil ) </syntaxhighlight>   ===Required Arguments===  thumb|DGS Button *'''x:''' A float of the...") | mNo edit summary | ||
| (9 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| __NOTOC__   | __NOTOC__   | ||
| {{Client function}} | {{Client function}} | ||
| Esta función crea un boton basado en dxDrawing. | |||
| <small>'''<span style="color:#ff0000; text-shadow:black 0em 0.1em 0.1em;">''Aviso: Esta es una función exportada por [[Modern-Library]]!''</span>'''</small> | |||
| ==Syntax==   | ==Syntax==   | ||
| <syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| element dxButton(  | element dxButton( int x, int y, int width, int height, string text [, element parent = nil, bool rounded = nil ] ) | ||
| </syntaxhighlight>   | </syntaxhighlight>   | ||
| ===Required Arguments===   | ===Required Arguments===   | ||
| [[Image:DGS_Button.png|thumb| | [[Image:DGS_Button.png|thumb|Boton]] | ||
| *'''x:'''  | *'''x:''' Un numero de la posición 2D x del botón en la pantalla de un jugador. | ||
| *'''y:'''  | *'''y:''' Un numero de la posición 2D y del botón en la pantalla de un jugador. | ||
| *'''width:'''  | *'''width:''' Un numero del ancho del botón. | ||
| *'''height:'''  | *'''height:''' Un numero de la altura del botón. | ||
| *'''text:'''  | *'''text:''' Una cadena del texto que se mostrará como una etiqueta en el botón. | ||
| ===Optional Arguments===   | ===Optional Arguments===   | ||
| *'''parent:''' Este es el padre el cual el [https://wiki.multitheftauto.com/wiki/dxButton boton] se adjunta. | |||
| *'''parent:'''  | *'''rounded:''' Si desea que el botón sea redondeado o no. ( true o false ) | ||
| *'''rounded:'''  | |||
| ==Example==   | ==Example==   | ||
| En este ejemplo se mostrará el mensaje del cuadro de edición en el cuadro de chat. | |||
| <syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| loadstring( exports.dxLibrary:dxGetLibrary( ) )( ) | |||
| -- | -- crea un boton | ||
| button = dxButton( 276, 80, 100, 40, "Anunciar!" ) | |||
| --  | -- cree un cuadro de edición y lo definimos como "editBox". | ||
| editBox = dxEdit( 277, 184, 197, 46, "Escribe tu mensaje aqui!" ) | |||
| function outputEditBox () | function outputEditBox () | ||
|          local text =  |          local text = dxGetText( editBox ) --Obtener el texto del cuadro de edición | ||
|          outputChatBox ( text, 255, 255, 255 ) -- |          outputChatBox ( text, 255, 255, 255 ) --anunciar ese texto | ||
| end | end | ||
| addEventHandler ( "onClick", button, outputEditBox ) | addEventHandler ( "onClick", button, outputEditBox ) | ||
| Line 49: | Line 40: | ||
| </syntaxhighlight> | </syntaxhighlight> | ||
| == | ==Ver también== | ||
| {{DXLIB_FUNCTIONS}} | {{DXLIB_FUNCTIONS}} | ||
Latest revision as of 20:25, 21 May 2022
Esta función crea un boton basado en dxDrawing.
Aviso: Esta es una función exportada por Modern-Library!
Syntax
element dxButton( int x, int y, int width, int height, string text [, element parent = nil, bool rounded = nil ] )
Required Arguments
- x: Un numero de la posición 2D x del botón en la pantalla de un jugador.
- y: Un numero de la posición 2D y del botón en la pantalla de un jugador.
- width: Un numero del ancho del botón.
- height: Un numero de la altura del botón.
- text: Una cadena del texto que se mostrará como una etiqueta en el botón.
Optional Arguments
- parent: Este es el padre el cual el boton se adjunta.
- rounded: Si desea que el botón sea redondeado o no. ( true o false )
Example
En este ejemplo se mostrará el mensaje del cuadro de edición en el cuadro de chat.
loadstring( exports.dxLibrary:dxGetLibrary( ) )( )
-- crea un boton
button = dxButton( 276, 80, 100, 40, "Anunciar!" )
-- cree un cuadro de edición y lo definimos como "editBox".
editBox = dxEdit( 277, 184, 197, 46, "Escribe tu mensaje aqui!" )
function outputEditBox ()
        local text = dxGetText( editBox ) --Obtener el texto del cuadro de edición
        outputChatBox ( text, 255, 255, 255 ) --anunciar ese texto
end
addEventHandler ( "onClick", button, outputEditBox )
Ver también
General Functions
- dxGetLibrary
- dxGetScreen
- dxSet
- dxGet
- dxSetText
- dxSetTitle
- dxSetVisible
- dxSetEnabled
- dxSetPosition
- dxGetPosition
- dxSetSize
- dxGetSize
- dxGetRootParent
- dxSetColorBackground
- dxSetColorText
- dxSetColorSelected
- dxSetColorBorder
- dxFont
- dxSetFont
- dxGetText
- dxSetTitle
- dxGetTitle
Window
Button
CheckBox
Edit
GridList
- dxGridList
- dxGridListAddItem
- dxGridListRemoveItem
- dxGridListAddColumn
- dxGridListRemoveColumn
- dxGridListGetItemSelected
- dxGridListSetItemSelected
- dxGridListGetScrollHV
Image
Label
List
- dxList
- dxListAddItem
- dxListRemoveItem
- dxListGetItemSelected
- dxListSetItemSelected
- dxListSetColorFilaItem
