Touch to scroll layout

Get help using Construct 2

Post » Thu May 10, 2012 8:11 am

Thanks for this suggestion but I really would love to avoid using this transparents objet. Because, as specified, it intercepts actions on active objects that it overlaps.
Would it be possible to use another approach with, for exemple, recording the absolute position of a click/touch spot on the screen and transmiting its movement to the layout ?
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Thu May 10, 2012 9:11 am

There is a lot of other way to do that but this way seems for me the better and also for scirra (it's a scirra tips)

If you still have a touch problem there is something wrong in your code. i send you a capx file with sample for better understanding ... if you still have problem share/send me your project for debugging.

(edit) LINK to a sample project file for auto scrolling feature ... the touch event is not intercept ... (if piece is touch the rotation of the piece is stop and start again if not).naelian2012-05-10 10:13:28
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Thu May 10, 2012 11:15 am

I was working a little on an 'ipad' like screen scrolling feature, but I was a bit too tired to work it out... There isn't much math but it is a little confusing...
Maybe this afternoon inspiration will strike ;)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu May 10, 2012 11:22 am

Woaw, It's absolutely amazing. Thank you Naelian.
But a few questions :
- is there a way to suppress the white margin that appears left and right of the background image at the en d of panning ?
- is there a way to make pan stop when an object on the scene is dragged ?
Thanks again !
Laurent
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Thu May 10, 2012 7:16 pm

Yes laurent, you can set black color to the layer so you will see black instead of white on borders ... if you want something more beautiful use a TiledBackground with texture and put in at the bottom of the layer.

Yes it's possible to make pan stop on piece drag ... overload the event for scrolling and add just under "is in touch" "not is dragging piece" (=> "is dragging piece" ("invert" mode)) ...

I update the sample project with all this settings to show you
always the same link => Here

* Add vertical scrolling and scrolling only if "piece" is not dragging
* Add Black color to layer
* Add TiledBackground with Wave Texture + Sine Opacity wave in/out effect
* Reduce opacity of the turtle sprite to see Sine Opacity wave in/out effect under it.

You can do great things with a few lines as you can see ... you just need more practice !naelian2012-05-10 19:56:59
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Previous

Return to How do I....?

Who is online

Users browsing this forum: flemmig, Matthew de, semaso, Skebab, Virpoja and 24 guests