ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. guiSetScale

Function

guiSetScale

ClientInterface (GUI)Trilogy Hub only

Sets the scale of the whole GUI (0.5-4, default 1): fonts, the title bar, list and tab rows. Control positions and sizes stay in script pixels.

Syntax

bool guiSetScale(float scale)

Arguments

scalefloat
Scale 0.5-4.

Returns

true on success.

Example

local sw, sh = guiGetScreenSize()
guiSetScale(math.min(sw / 1920, sh / 1080))

Notes

Text fits its controls. When single-line text (button, label, checkbox, window title) or a row of tabs does not fit its space, the GUI shrinks the font down to 70% at most and ends the rest with an ellipsis. A window sized from the resolution (e.g. 1000 * sh / 1080) no longer cuts text on small screens, but it reads better with guiSetScale set to the same factor as the window size.