DxGUI/dxGetPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "<pageclass class="client" subcaption="GUI Class method"></pageclass> __NOTOC__ You can use this function to get dxElement position. ==Syntax== <syntaxhighlight lang="lua"> x,y (Title:x,Title:...")
 
 
Line 6: Line 6:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
x,y (Title:x,Title:y) dxElement ( dxElement element, [bool relative = false])
float x, float y (float Title:x,float Title:y) dxGetPosition (element dxElement, [bool relative = false])
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''element:''' A dxGUI element.
*'''dxElement:''' A dxGUI element.


<!-- Only include this section below if there are optional arguments -->
<!-- Only include this section below if there are optional arguments -->

Latest revision as of 20:25, 25 May 2012


You can use this function to get dxElement position.

Syntax

float x, float y (float Title:x,float Title:y) dxGetPosition (element dxElement, [bool relative = false])

Required Arguments

  • dxElement: A dxGUI element.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • relative: This is whether sizes and positioning are relative. If this is true, they send relative x,y,(Title:x,Title:y) positions.

Returns

  • x: An element x position
  • y: An element y position
  • Title:x: An element titlebar x position.(It's for only dxWindows)
  • Title:y: An element titlebar y position.(It's for only dxWindows)

Example

This example gets window position and multiply with 2.

local x,y = dxGetPosition(ourWindow)
dxSetPosition(ourWindow,x*2,y*2) 

See Also

Back to dxGUI page