obj
option1
var/img
New(l,mob/M)
..()
var/mylocx5 = usr.x+3
var/mylocy5 = usr.y+1
img=image ('menu.dmi',locate(mylocx5,mylocy5,usr.z),"color",2)
M << img
Del()
if(img) del(img)
Click()
var/color = input("What color do you want to be?") in list ("Blue","Yellow")
usr.icon_state = color
Although this gives away what my demo is about, I still need to finish it.
Also, i create the obj like this:
new/obj/option1(mylocx5,mylocy5,usr.z)
Thanks,
-Rcet
This is the problem. You'll notice the source I presented attaches img to the object itself (src), not to the same location. You're attaching the image to the turf, not the object, so the object is useless; since the image is located in the turf, the turf receives the Click() proc.
By attaching the image to an object, the object can be made unique for each player and can be given a name that doesn't match the turf around it. (The object's name will show when you mouseover the image.)
I would avoid using usr in the object creation process unless there's some particular reason that's better. Since you have M available, if you want this interface to be for M, use M.x, M.y, and M.z instead for the obj's location. But the image should be located in the obj; otherwise the obj is useless.
Lummox JR