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.

AppGameKit Classic Chat / Drag and Drop

Author
Message
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Nov 2011 17:25
Anybody got some minimalist drag and drop code? Can't spot any in the examples.

-- Jim
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 25th Nov 2011 21:04
You might want to be more specific...

What type or for what purpose...

Just saying...

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Nov 2011 23:35
Fair enough!

Drag the word "head" onto a picture which has the head defined as a target zone. Dropping on the arm is wrong.

-- Jim
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Nov 2011 21:11
You can detect whether a sprite is under the pointer and whether the pointer is being pressed. Also you can detect where the pointer is on the screen. Using this information is not a big step after that:


Of course if you want to check whether the drop off point is valid that's extra code!

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 27th Nov 2011 00:19
Thanks baxslash. DIY drag-drop then!

-- Jim
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th Nov 2011 09:12
Yes, but as with most things it gives you more flexibility in how your controls work.

Nitish
12
Years of Service
User Offline
Joined: 16th Dec 2011
Location:
Posted: 16th Dec 2011 17:48
Thnx baxslash,

the technique works great, using it in my upcoming game.

Thnx

-----------------------------------------
New To Game Develop... But with 10 years of programming experience
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Dec 2011 19:09
Glad to help!



Login to post a reply

Server time is: 2024-04-26 13:16:08
Your offset time is: 2024-04-26 13:16:08