Hand-made Drag and Drop

Post your own tutorials, guides and demos.

Post » Sat Oct 08, 2011 5:58 pm

Can anyone make some kind of Drag and Drop using only events?
Simple Drag and Drop behavior doesn't works fine.
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Post » Sat Oct 08, 2011 6:03 pm

What exactly doesn't work for you? And if so why don't YOU make it and share with the community?
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Oct 08, 2011 6:10 pm

You could use:

+ MouseKeyboard: On Left Clicked on Sprite
-> Sprite: Set 'drag' to 2

+ Sprite: Value 'drag' Equal to 2
+ MouseKeyboard: Left mouse button is down
-> Sprite: Set position to MouseX, MouseY

+ MouseKeyboard: On Left mouse button released
-> Sprite: Set 'drag' to 1

sample cap

B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sat Oct 08, 2011 6:15 pm

[QUOTE=Somebody] What exactly doesn't work for you?[/QUOTE]
For example inventory.
http://dl.dropbox.com/u/34384736/drag%26drop.cap
Put red sprites on the black. Then press 1 (to turn off drag'n'drop). After this try to drag some red sprites again and then press 2 (to turn drag'n'drop on) and you will see what i'm talkin' about.

[QUOTE=Somebody] What exactly doesn't work for you? And if so why don't YOU make it and share with the community?[/QUOTE]
I'm too tired today, lol :c
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Post » Sat Oct 08, 2011 6:18 pm

[QUOTE=chrisbrobs] You could use:

+ MouseKeyboard: On Left Clicked on Sprite
-> Sprite: Set 'drag' to 2

+ Sprite: Value 'drag' Equal to 2
+ MouseKeyboard: Left mouse button is down
-> Sprite: Set position to MouseX, MouseY

+ MouseKeyboard: On Left mouse button released
-> Sprite: Set 'drag' to 1

sample cap

[/QUOTE]

You are my hero :3
B
38
S
15
G
6
Posts: 238
Reputation: 7,760


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 2 guests