DxGUI/dxCreateButton: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "==Syntax== <syntaxhighlight lang="lua"> element dxCreateButton( float x, float y, float width, float height, string text,[element parent = nil, int color, string font, string theme] ) </syntaxhighlight> ...")
 
No edit summary
 
Line 1: Line 1:
This function is for creating a new dxGUI button.
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 17: Line 19:
===Returns===
===Returns===
Returns a dxgui element of the created button if it was successfully created, false otherwise.
Returns a dxgui element of the created button if it was successfully created, false otherwise.
==Example==
'''Example 1:''' This example creates a button.
<syntaxhighlight lang="lua">
exports.dxGUI_v1:dxCreateButton(0,0,250,300,"Hello!",tocolor(255,0,0,255),"default-bold","Orange")
</syntaxhighlight>

Latest revision as of 15:39, 1 October 2013

This function is for creating a new dxGUI button.

Syntax

element dxCreateButton( float x, float y, float width, float height, string text,[element parent = nil, int color, string font, string theme] )

Required Arguments

  • x: A float of the 2D x position of the dxGUI window on a player's screen.
  • y: A float of the 2D y position of the dxGUI window on a player's screen.
  • width: A float of the width of the dxGUI window.
  • height: A float of the height of the dxGUI window.
  • text: A string of the text that will be displayed in the button.
  • parent: This is the parent that the gui button is attached to.
  • color: This the color of dxGUI: tocolor(255,255,255,255).
  • font: This the font text of dxGUI titleBarText: "default-bold".
  • theme: This the theme of dxGUI: "Lighter Black","Lighter Blue","Orange" in themes.xml you can add more.

Returns

Returns a dxgui element of the created button if it was successfully created, false otherwise.

Example

Example 1: This example creates a button.

exports.dxGUI_v1:dxCreateButton(0,0,250,300,"Hello!",tocolor(255,0,0,255),"default-bold","Orange")