Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Drag and Drop of Sprites HELP!!

Author
Message
elsole
14
Years of Service
User Offline
Joined: 4th Dec 2009
Location:
Posted: 8th Jan 2010 14:10
I was trying to think on how to make my sprites be drag and drop using a mouse making but i couldn't figure out how to code this. What i would like to do is that there is my main image, i'll drag and drop it on a specified location and then drop it making them now 2. But my problem is that i can't make another new sprites to be drag and drop not making the other one disappear.

Heres my code:



Thanks!
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 8th Jan 2010 20:02
To make sure I understand correctly: when you drag and drop a sprite, you want to create a copy of that sprite at the new location? So the end result is that you will have two sprites? And if you drag and drop one of them again, then three sprites and so on?
elsole
14
Years of Service
User Offline
Joined: 4th Dec 2009
Location:
Posted: 9th Jan 2010 04:56
Yes that is clearly what i mean. Could you help me just an idea coz my mind's really crap and got confused on what to do.

Any help would do. Thanks
Akimon
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 9th Jan 2010 11:40
This is what I got so far but the problem is that when you drag, all sprites pop up.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 9th Jan 2010 12:49
Use dbCloneSprite. Here is a simple program which copies always the first sprite when you press the mouse button and gives a new ID number to the new sprite.



You can further develop this code to copy that sprite which the mouse is over. The simplest way is probably to create a mouse cursor sprite which moves together with the mouse, then check sprite collision between the mouse sprite and all, already created sprites. This way you can determine which one needs to be cloned and dragged.
elsole
14
Years of Service
User Offline
Joined: 4th Dec 2009
Location:
Posted: 9th Jan 2010 23:51
thanks this really help a lot.

Login to post a reply

Server time is: 2024-10-01 20:16:06
Your offset time is: 2024-10-01 20:16:06