guiSetSize | Multi Theft Auto: Wiki Skip to content

guiSetSize

Client-side
Server-side
Shared

Pair: guiGetSize

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function sets the dimensions (size) of a GUI element. It refers to the bounding box size for GUI elements. It does not make GUI elements smaller or larger in appearance.

Syntax

guiSetSize ( )

Code Examples

client

This example creates a gui window and changes the x and y width of the window every 2 seconds.

function changeWindowSize ( )
--Called by the timer every 2 seconds. It decides an x and y width randomly between .1 and .5
guiSetSize ( myWindow, ( math.random( 10, 50 ) / 100 ), ( math.random( 10, 50 ) / 100 ), true )
end
--Create a gui window called 'myWindow'
myWindow = guiCreateWindow ( 0.3, 0.3, 0.5, 0.60, "GUI window title", true )
--Set a timer to change the window's size every 2 seconds, infinite times
setTimer ( changeWindowSize, 2000, 0 )

See Also

GUI Functions