Vector.ToScreen

From GMod Wiki

Jump to: navigation, search
Function
Syntax Vector:ToScreen( )
Description:
Returns the draw position on the screen for a position in space.
Returns: Table
In Object: Vector
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Vector.ToScreen]Vector.ToScreen [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Additional Notes

Examples

DescriptionDraws a square over position 0, 0, 128 in the level.
Used onNewerClient.png
Code
 
function render_square()
   local pos = Vector(0, 0, 128):ToScreen()
  surface.DrawRect( pos.x - 16, pos.y - 16, 16, 16 )
end
 
hook.Add( "HUDPaint", "square", render_square )
 
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox