ID:148012
 
I'm trying to get images to appear in a browser, but it's being ignorant and showing the icon as the lil red x.
proc
WeaponShop()
return \
var/obj/sword = new
sword.icon = 'items.dmi'
sword.icon_state = "sword"
{"<html><b><center><body bgcolor=black><font color=red><font size=5><font face=verdana>Weapon Shop</center></font><font color=green size=3><IMG CLASS=icon SRC=\ref[sword.icon] ICONSTATE='[sword.icon_state]'> Sword (500 gold)"}
return
mob/shopkeeper
weapons
verb/Buy()
set src in oview(1)
src << browse(WeaponShop(),"window=weaponshop")

The browser window pops-up, but the sword icon is the little x (a.k.a the x for images not found)
Can anyone help me?
You're pretty close, but there's a couple of things you've missed.

- You need to use browse_rsc() on the icons.

- You need to reference the icons as normal images, like this:
<img src='whatever.dmi'>


Look up browse_rsc() in the reference for more information.
In response to Crispy
He could also take an object with an icon and use [ and ] to put that in the browser window.