Restrict diagonal movement of drag and drop?

Get help using Construct 2

Post » Mon Jan 16, 2017 6:05 am

Hello,

I want a draggable block to only be draggable horizontal and vertically, but not diagonally.

I can only choose from 'both' or 'horizontal' and 'vertical'. Would be nice to see an extra 'diagonal' option so I can choose 'both' as I expect it to be.

In the meanwhile, does anyone know how to get the draggable block to move to horizontal and vertical only?

Thanks!

- R
B
13
S
7
G
3
Posts: 131
Reputation: 3,057

Post » Fri Jan 20, 2017 8:35 pm

How can you drag both vertical and horizontal at the same time without going diagonal?
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 » Fri Jan 20, 2017 9:31 pm

I would guess by snapping to a grid.
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Fri Jan 20, 2017 9:49 pm

Hello all,

Well, I'm wanting to be able to "slide" the object left or right -> dismiss object. On click once object will rotate. Slide up it will go up. I got it made so the object can be "slide" up but I could only choose horizontal or vertical or both.

Hopefully I made it a bit more clear.
B
13
S
7
G
3
Posts: 131
Reputation: 3,057

Post » Fri Jan 20, 2017 9:50 pm

Drag & Drop doesn't work but I made one using LERP and Timers.

Here you go dude: http://s000.tinyupload.com/?file_id=935 ... 9766445804
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Fri Jan 20, 2017 9:53 pm

Hello,

thanks, I tried downloading but my browser (Firefox) says it contains a virus, lol, so I can't download it?
B
13
S
7
G
3
Posts: 131
Reputation: 3,057

Post » Fri Jan 20, 2017 9:55 pm

Wait I better use another file hosting.
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Fri Jan 20, 2017 9:56 pm

These public file hosting sites are a pain.
I should use DropBox more often.

Here: https://www.dropbox.com/s/g7hvgyps92stw ... .capx?dl=0
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Fri Jan 20, 2017 10:14 pm

Sorry for the triple post everyone.

Here's a SLIGHTLY IMPROVED version.
https://www.dropbox.com/s/upvvhovlrnlwn ... .capx?dl=0

Drag and Drop readjusts so you don't have to let go of the box everytime you want to shift axis.
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Mon Jan 23, 2017 9:15 pm

Rudi55 wrote:Hello all,

Well, I'm wanting to be able to "slide" the object left or right -> dismiss object. On click once object will rotate. Slide up it will go up. I got it made so the object can be "slide" up but I could only choose horizontal or vertical or both.

Hopefully I made it a bit more clear.


You can just change the lock axis on the Drag and Drop behavior on the fly perhaps?
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: marc254 and 10 guests