Garry's Mod Wiki

Revision Difference

Vector:ToScreen#519017

<function name="ToScreen" parent="Vector" type="classfunc"> <description> Returns where on the screen the specified position vector would appear. A related function is <page>gui.ScreenToVector</page>, which converts a 2D coordinate to a 3D direction. <note>Should be called from a 3D rendering environment or after <page>cam.Start3D</page> or it may not work correctly.</note> <bug issue="462">Errors in a render hook can make this value incorrect until the player restarts their game.</bug> <bug issue="1404"><page>cam.Start3D</page> or 3D context <page>cam.Start</page> 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 (<page>cam.Start3D</page> with no arguments).</bug> </description> <realm>Client</realm> <rets> <ret name="" type="table">The created <page>ToScreenData</page>.</ret> <ret name="" type="table">The created <page>Structures/ToScreenData</page>.</ret> </rets> </function>