You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hook.Add("PreDrawHUD", "", function()
cam.Start3D(nil, nil, 20) -- Create and destroy a 3D rendering context with a FOV of 20cam.End3D()
cam.Start2D()
-- This call to ToScreen thinks that the screen's FOV is 20localpos=Vector(0, 0, 0):ToScreen()
localx, y=pos.x, pos.ysurface.SetDrawColor(Color(255, 0, 0))
surface.DrawRect(pos.x-16, pos.y-16, 32, 32)
cam.End2D()
cam.Start3D() -- Create and destroy a default 3D rendering contextcam.End3D()
cam.Start2D()
-- This call to ToScreen thinks that the screen's FOV is its real valuelocalpos=Vector(0, 0, 0):ToScreen()
localx, y=pos.x, pos.ysurface.SetDrawColor(Color(0, 255, 0))
surface.DrawRect(pos.x-16, pos.y-16, 32, 32)
cam.End2D()
end)
This example shows the issue by modifying the FOV, but changing any parameter to Start3D will cause this.
The confusing thing about this is that in some cases it is optimal behaviour, but usually it isn't.
The text was updated successfully, but these errors were encountered:
This example shows the issue by modifying the FOV, but changing any parameter to Start3D will cause this.
The confusing thing about this is that in some cases it is optimal behaviour, but usually it isn't.
The text was updated successfully, but these errors were encountered: