GuiGetSize: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| No edit summary | No edit summary | ||
| Line 1: | Line 1: | ||
| __NOTOC__   | __NOTOC__   | ||
| This function gets the size of a GUI element | |||
| This  | |||
| ==Syntax==   | ==Syntax==   | ||
| <syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| guiGetSize ( element  | float, float guiGetSize ( element theElement ) | ||
| </syntaxhighlight>   | </syntaxhighlight>   | ||
| ===Required Arguments===   | ===Required Arguments===   | ||
| *'''theElement:''' The GUI element to get size of | |||
| *''' | |||
| ===Returns=== | ===Returns=== | ||
| Returns the GUI element size if the function has been successfull, ''false'' otherwise. | |||
| ==Example==   | ==Example==   | ||
| This example creates a random sized gui window and outputs it's size to chatbox... | |||
| <syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| -- | function test () | ||
|         --Create the window | |||
|         local window = guiCreateWindow ( 0, 0, randInt ( 0, 100 ) / 100, randInt ( 0, 100 ) / 100, "test", true ) | |||
|         local x, y = guiGetSize ( window ) | |||
|         outputChatBox ( "Window size: "..x.." "..y ) | |||
| end | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| ==See Also== | ==See Also== | ||
| {{FunctionArea_functions}} | {{FunctionArea_functions}} | ||
| [[Category:Need_Syntax]]  -- leave this until syntax is available. Cannot document the function or event without syntax. | [[Category:Need_Syntax]]  -- leave this until syntax is available. Cannot document the function or event without syntax. | ||
Revision as of 18:27, 9 August 2007
This function gets the size of a GUI element
Syntax
float, float guiGetSize ( element theElement )
Required Arguments
- theElement: The GUI element to get size of
Returns
Returns the GUI element size if the function has been successfull, false otherwise.
Example
This example creates a random sized gui window and outputs it's size to chatbox...
function test ()
        --Create the window
        local window = guiCreateWindow ( 0, 0, randInt ( 0, 100 ) / 100, randInt ( 0, 100 ) / 100, "test", true )
        local x, y = guiGetSize ( window )
        outputChatBox ( "Window size: "..x.." "..y )
end
See Also
Template:FunctionArea functions -- leave this until syntax is available. Cannot document the function or event without syntax.