How do I drag a sprite with touch controls?

Get help using Construct 2

Post » Tue May 27, 2014 10:39 pm

This is for my sandwich game again, I need to figure out how to format the touch event in a way where you can touch the slice of bread at the bottom of the screen and drag your finger across the screen to make it move.
B
10
S
1
Posts: 69
Reputation: 641

Post » Tue May 27, 2014 10:40 pm

Give the bread the "Drag and Drop" behavior. That's all you have to do.
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Tue May 27, 2014 11:22 pm

Okay, now is there a way to restrict it to just moving from side to side?
B
10
S
1
Posts: 69
Reputation: 641

Post » Wed May 28, 2014 4:00 am

The drag and drop behavior has a property call "Axes". Set it to Horizontal Only.

[Edit] I realized I made an assumption when I wrote this. I assumed you knew where the properties for behaviors were. If you do already know, you don't need to read any further.

If not, I'm sorry. I should have been more clear. This is how you get to the properties for behaviors. The entire left of the screen is a menu called Properties. Select the Bread object in the objects menu on the right of the screen and the Properties panel on the left will show properties for the sprite. If look through those, you will find the Behaviors group and inside is the DragDrop behavior.
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Wed May 28, 2014 5:51 am

B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Wed May 28, 2014 6:36 am

I found this demo done by some one look at it and see if it can help you
You do not have the required permissions to view the files attached to this post.
B
250
S
39
G
15
Posts: 1,953
Reputation: 40,623


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 14 guests