How do I Swap object using Drag Drop?

Get help using Construct 2

Post » Mon Jan 09, 2017 6:58 am

How do i swap object between 2 places.?

example would be :

A at position 1.
B at position 2.

when i drag A(at pos 1) and move to B(at pos 2, B will automatic move to Pos 1(which is previously held by A)

Thanks..
B
9
S
2
Posts: 40
Reputation: 673

Post » Mon Jan 09, 2017 4:31 pm

You use the drag and drop behavior for objects, and when A is over position 2, on mouse release you can set A.x and A.y to position 2. Visa versa for B.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue Jan 10, 2017 10:55 am

Can you show me an example capx? thanks.
B
9
S
2
Posts: 40
Reputation: 673

Post » Tue Jan 10, 2017 6:45 pm

neilgomes wrote:Can you show me an example capx? thanks.


I was afraid you would ask this... give me a bit.

https://drive.google.com/open?id=0B-xiq ... GRfSlpHd00

Seriously though, you need to learn to search Google or the Scirra forums for stuff. You can even use cascaded searching in the Scirra forums.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Wed Jan 11, 2017 4:20 am

Thanks for the capx gumshoe2029 . But how do i swap back to original position?
B
9
S
2
Posts: 40
Reputation: 673

Post » Thu Jan 12, 2017 5:36 pm

neilgomes wrote:Thanks for the capx gumshoe2029 . But how do i swap back to original position?

Just reverse the original variables for A & B.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822


Return to How do I....?

Who is online

Users browsing this forum: combotg, Lancifer and 8 guests