Garry's Mod Wiki

Revision Difference

Global.ScreenScale#546315

<function name="ScreenScale" parent="Global" type="libraryfunc"> <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.</description> <realm>Client</realm> <file line="6-L8">lua/includes/extensions/client/globals.lua</file> <args> <arg name="Size" type="number">The number you want to scale.</arg> </args> <rets>⤶ <ret name="" type="number">The scaled number based on your screen's width</ret>⤶ </rets>⤶ </function> <example> <description>Prints a scaled number based on the number 96, 400 and 640.</description> <code> print( ScreenScale( 96 ) ) print( ScreenScale( 400 ) ) print( ScreenScale( 640 ) ) </code> <output>252, 1050, 1680 (this will differ depending on your screen width. Here the screen width is 1680.)</output> </example>