ID:166368
 
How would I go about making it so a player can click and object in their inventory, and move the mouse to the screen (the object would appear under and follow the mouse), and click again to place it somewhere? Can anyone recommend any good demos or libraries? Thanks.
You can assign atom.mouse_drag_pointer to the item's icon, which will show it when the item is being dragged.
Eg:
atom/hi
icon='hi.dmi'
MouseDrag()
mouse_drag_pointer=src.icon
MouseDrop()
mouse_drag_pointer=null



Ofcourse you should look them up before using it <.<

- GhostAnime
In response to GhostAnime
How do I make it so you can drag from an inventory statpanel, though? I made it so it appears in the statpanel, but I can't get it to change the cursor icon and drag to the map.
In response to Seraphrevan
When you change the cursor, it only works while it is on the gaming screen...
In response to Satans Spawn
I know that, but I want it so you can drag an item from your inventory, and when your cursor reaches the screen, it changes. I can't get it to do that.
In response to Seraphrevan
Check the MouseDrag proc, and the mouse_pointer_icon var in the help files. That should be enough to set you on your way I would imagine.

§atans§pawn
In response to Satans Spawn
I don't understand the arguments for the MouseDrag() and MouseDrop(). Could you explain it to me? Sorry
In response to Seraphrevan
MouseDrop:

over_object: the object that you release the mouse button over. In your case, it would most likely be the turf on the map. I don't believe it will accept a turf however.

src_location: Where you picked up the item from. It is an unneeded argument.

over_location: Where the object that you are dropping onto is located.

After I actually re-look at the mousedrag proc, you don't even need that. All you need is MouseDrop()

p.s. I can send you a little demo I made for an FF game that I was going to be a part of. I used MouseDrop for the materia system...

§atans§pawn