Garry's Mod Wiki

ScrH

number ScrH()

Description

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

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( Color( 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.

Page Links


Special Pages


Wikis

?

Render Time: 30ms

DB GetPage 3
Generate Html 2
SaveChanges (1) 9
Render Body 0
Render Sidebar 14