Image Draw


Could someone quickly do some code for me what can allow me to draw a image file on the screen with set positions.

(I don’t want wiki links)


var url = ""; // your image url here
var x = 200;
var y = 500;

		.attr("src", url)
		.css("position", "absolute")
		.css("top", x)
		.css("left", y)

Thank you, Where would the code go?

Hello? Anyone? Also where does this position this on the screen

If you can’t understand that the above code isn’t even Lua and you don’t want to understand/make-use of the great wiki sources for GLua…
I don’t know what to tell ya.

It’s pretty funny you don’t want Wiki links when Maurits literally tells you the answer:

I’m quite against writing out code for people on Facepunch especially if they don’t try it themselves first and while some people like to, I feel this post kinda proves why you shouldn’t.

It’s a js script, if you wanted someone to spoon feed on you, then you’re going to get this kind of replies
But please…Do some research, nobody will code here for you and for free




local ourMat = Material( "models/wireframe" ) -- Put your material here (relative to the materials/ path, and if it's not a .vmt file, put the extension!

hook.Add( "HUDPaint", "example_hook", function() -- Rename the 'example_hook' to something unique to avoid it getting overwritten
	surface.SetDrawColor( 255, 255, 255, 255 ) -- Draw in completely white
	surface.SetMaterial( ourMat ) -- Sets the material as the one from before
	surface.DrawTexturedRect( x, y, width, height ) -- Pretty self-explanatory
end )