I've been told that your icon files are already in the resource cache, so you do not need to use browse_rsc to display them.
My question is how do you use the < IMG > tag to display a specific icon? I do not want to /icon macro, because I am defining the HTML in a const var. I simply want to reference the icon file, and the icon state and I need to know the exact syntax to do this.
ID:159557
Feb 18 2009, 2:13 pm
|
|
In response to Immibis
|
|
It seems kind of ridiculous to me that you can't display specific iconstates. In the example code for the /icon text macro, it uses the ICONSTATE img tag attribute, but I have never been able to get it to work.
even the entry in Tags (text) for is //display icons So one would think that you'd be able to use it to display icons... |
In response to GauHelldragon
|
|
It works in the output, ie src << "text..." or world << "text..."
But not in browse() because Internet Explorer doesn't understand ICONSTATE. |
In response to Immibis
|
|
Hm. Fair enough. I ended up using regular image files instead of trying to use the ingame icons.
|
In response to GauHelldragon
|
|
client/proc/browse_rsc_icon(icon, icon_state) Call browse_rsc_icon with an icon and icon state to send that icon state to the client. To display an icon (after using browse_rsc_icon): <img src="[icon]_[icon_state].png" style="width: 32px; height: 32px;"> |
For a .dmi file with only one icon state, just use
in your html.
If you want one state from a file, you need to create an /icon object with that state, browse_rsc() it (with a file name; that will create a file in the resource cache with just that state that the client can access) and display it as above.