Garry's Mod Wiki

surface.ScreenWidth

  number surface.ScreenWidth()

Description

We advise against using this. It may be changed or removed in a future update. You should use ScrW instead.

Returns the width of the current client's screen.

Returns

1 number
screenWidth

Example

Prints out the current width of the screen.

MsgN("Screen width: " .. surface.ScreenWidth())
Output: Screen width: 1920