Garry's Mod Wiki


GM:OnScreenSizeChanged( number oldWidth, number oldHeight )


Called when the player's screen resolution of the game changes. ScrW and ScrH will return the new values when this hook is called.


1 number oldWidth
The previous width of the game's window.
2 number oldHeight
The previous height of the game's window.


When a player change his Screen Size it's print the old Size and the new size.

hook.Add( "OnScreenSizeChanged", "PrintOld", function( oldWidth, oldHeight ) print( oldWidth, oldHeight ) -- Prints old width and height print( ScrW(), ScrH() ) -- Prints new width and height end )

Page Links

Special Pages



Render Time: 32ms

DB GetPage 3
Generate Html 5
SaveChanges (1) 9
Render Body 0
Render Sidebar 12