DxGUI/dxGetSize: Difference between revisions
Jump to navigation
Jump to search
Kacper Karer (talk | contribs) (→Syntax) |
Kacper Karer (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<pageclass class="client" subcaption="GUI Class method"></pageclass> | |||
__NOTOC__ | |||
You can use this function to get dxElement size. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 15: | Line 20: | ||
*'''w''': An element width | *'''w''': An element width | ||
*'''h''': An element height | *'''h''': An element height | ||
==Example== | |||
This example gets window relative size. | |||
<syntaxhighlight lang="lua"> | |||
local w,h = dxGetSize(dxWindow,true) | |||
outputChatBox(w.." "..h) | |||
</syntaxhighlight> | |||
==See Also== | |||
[[dxGUI|Back to dxGUI page]] |
Latest revision as of 14:36, 16 August 2012
You can use this function to get dxElement size.
Syntax
float w, float h dxGetSize (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, script give relative w,h.
Returns
- w: An element width
- h: An element height
Example
This example gets window relative size.
local w,h = dxGetSize(dxWindow,true) outputChatBox(w.." "..h)