Drawing a sprite which is unaffected by distance?

How would I go about creating a sprite, that doesn’t change size on distance? (So you can be at the other side of the map and it will still be 16pixels big on screen etc)

[lua] cam.Start3D(EyePos(),EyeAngles())
render.SetMaterial( material )
render.DrawSprite( pos, 16, 16, white)
cam.End3D()
[/lua]

Like the above code, but doesn’t change size with difference from it?

Draw it on the screen and not in 3d space.

You can use **[Vector.ToScreen

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Vector.ToScreen)** to get the position on screen from the world coordinates.

Ah perfect! Thanks

I completely forgot about that function.

[editline]01:15PM[/editline]

Hmm, I’ve run into another problem. Is there something similar to SWEP:DrawHud() but for ENT?

I’m really late, but whatever. I’m sure you don’t need help with this now.

This is from an old flare ent i made



local FlareEffect = Material("sprites/dot")
local BallEffect = Material("effects/yellowflare")

function ENT:Draw()
	self.Entity:DrawModel()
	if CLIENT then
		render.SetMaterial(FlareEffect)
		local Distance = LocalPlayer():GetPos():Distance(self:GetPos())/60 + 0.1
		local Distance2 = LocalPlayer():GetPos():Distance(self:GetPos())/200 + 0.1
		render.DrawSprite(self:GetPos(),8*Distance,0.5*Distance2,Color(255,250,200,255))
		render.SetMaterial(BallEffect)
		render.DrawSprite(self:GetPos(),6*Distance,6*Distance,Color(255,250,200,255))
	end
end


Only 6 years