Garry's Mod Wiki

Garry's Mod Wiki

  number ScrH()

Description

Gets the height of the game's window (in pixels).

ScrH() returns the height from the current viewport, this can be changed via render.SetViewPort, inside Render Targets and cam.Start contexts.

Returns

1 number
The height of the game's window in pixels

Example

Prints the Height of the window.

print( ScrH() )
Output: 1080 (depends on your screen).

Example

Draws a white box on the top left corner of your screen.

hook.Add( "HUDPaint", "WhiteBox", function() surface.SetDrawColor( 255, 255, 255, 255 ) surface.DrawRect( 0, 0, ScrW() / 2, ScrH() / 2 ) end )
Output: A white box on the top left corner of your screen.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...