GuiGetSize

From Multi Theft Auto: Wiki
Revision as of 15:03, 18 August 2007 by Arc (talk | contribs)
Jump to navigation Jump to search

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 successful, false otherwise.

Example

This example creates a random sized gui window and outputs its size to the chatbox.

-- Create the window
local window = guiCreateWindow ( 0, 0, randInt ( 0, 100 ) / 100, randInt ( 0, 100 ) / 100, "test", true )
-- Get its size and output to chatbox
local x, y = guiGetSize ( window )
outputChatBox ( "Window size: " .. x .. " " .. y )

See Also

Template:FunctionArea functions -- leave this until syntax is available. Cannot document the function or event without syntax.