Garry's Mod Wiki

ScreenScale

  number ScreenScale( number Size )

Description

Returns a number based on the Size argument and your screen's width. The screen's width is always equal to size 640. This function is primarily used for scaling font sizes.

Arguments

1 number Size
The number you want to scale.

Returns

1 number
The scaled number based on your screen's width

Example

Prints a scaled number based on the number 96, 400 and 640.

print( ScreenScale( 96 ) ) print( ScreenScale( 400 ) ) print( ScreenScale( 640 ) )
Output: 252, 1050, 1680 (this will differ depending on your screen width. Here the screen width is 1680.)