ID:900035
 
Keywords: browse, turn
Code:
mob
verb
TestImageTurn()
var/obj/S = new/obj/
//-----------------------
var/icon/S1 = new("Image2Save.png")

S1.Scale(32,40)
S1.Turn(90)

//-----------------------
S.icon = S1
S.loc = locate(usr.x,usr.y-4,usr.z)

usr<<browse("<img src='Image2Save.PNG' />")


Problem description:

Problem 1

I have been trying to Turn an icon which is made and assigned to an object from an image as shown from the example above. Does anyone know a better way to do this ? any help would be helpful. Turn 90 degrees does not seem to work the way I have done it.

Sorry for the demand but if anyone knows how to do that then that would be great, am stuck!!

Thanks!
Problem 2

I have been trying to output an image which is stored in the local directory but it is not working with usr<<browse(""). Im not sure how to do the ../Image2Save.png trick but it would be good to know how to do that as well. usr<<browse(S1) works but I want to use img src.

Trying not to post too much!
You need to use browse_rsc() to send the actual icon to the player's cache for display. Right now it's just pulling the original 'Image2Save.PNG' file out the RSC, and not the altered one.

Also, Turn() only works on square icons. You'll have to Crop() the icon to make it square and then turn it.