ID:173622
 
Hi,i want to know how to make pics on the screen while you are playing {ex. health bars on screen). But i lost my old code and i forgot how i did it.

I want to make this icon(icon = 'screen objs.dmi',iconstate = "inv") show on the screen. (and maybe later i might need a code to put the gun icon in the inv)
*waits*
client
var/obj/ScrObj
New()
. = ..()
ScrObj = new
ScrObj.icon = icon(icon = 'screen objs.dmi',iconstate = "inv")
ScrObj.screen_loc = "1,1"
screen += ScrObj


Create the objects, assign a screen_loc, and add to client.screen.

If you don't set the object to "new" right away, it will be null untill you do set it to something else.