Vector/ToScreen

From Garry's Mod
Jump to: navigation, search
 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.

NOTE

Should be called from a 3D rendering environment or after cam.Start3D or it may not work correctly.

BUG

Errors in a render hook can make this value incorrect until the player restarts their game.

Issue Tracker: #462

BUG

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).

Issue Tracker: #1404

Returns

Personal tools
Navigation