Garry's Mod Wiki

Vector:ToScreen

table Vector:ToScreen()

Description

Returns where on the screen the specified position vector would appear. A related function is gui.ScreenToVector, which converts a 2D coordinate to a 3D direction.

Should be called from a 3D rendering environment or after cam.Start3D or it may not work correctly.
Errors in a render hook can make this value incorrect until the player restarts their game.
cam.Start3D or 3D context cam.Start with non-default parameters incorrectly sets the reference FOV for this function, causing incorrect return values. This can be fixed by creating and ending a default 3D context (cam.Start3D with no arguments).

Returns

Page Links


Special Pages


Wikis

?

Render Time: 31ms

Session 0
DB GetPage 3
Generate Html 6
SaveChanges 8
Render Body 0
Render Sidebar 11