How to Scroll Screen View via Swipe?

henson802

  • Posts: 381
Greetings all,

I have scenes that are beyond the screen size.  Right now - I have left and right arrows - that when pressed, increase variable x by 4 or so.. then , I have the screen view command follow based on that x variable.  So when you are pressing the button - it's scrolling the screne to the right by 4 pixels or whatever I input for variable x to increment.

Pretty easy .. but for the life of me, can't figure out how to scroll the screen if I swipe anywhere on scene.  I know there is those commands for 'if swipe right/left/up/down/' etc. but not quite sure how to make the screen scroll to the right when your finger swipes right... I tried basically doing same thing with the button scroll by declaring variable x and incrementing by 4 when swiped to right, but it doesn't work.

Any help or input appreciated..

vodkaman6661

  • Posts: 121
There's a game on stencyl forge called swiping menu by dizko which can be used to swipe on any ios device or on windows by using the mouse.

i've taken a screen shot of the code for you to.

henson802

  • Posts: 381
Thanks for this.. I haven't had much time but will attempt this code later.

I'm wondering though, I have actors that can be touched, dragged and dropped in other scenes.  I will try this on my menus screen to see how it works then attempt it on scenes with actors that can be dragged and dropped as well.. see what happens.

Appreciate it!

henson802

  • Posts: 381
I think this was for Stencyl 2 .. I'm using Stencyl 3-

Anyone know how to implement a swipe to move camera?  Someone ought to since there are iOS apps out there that been used with Stencyl 3... :-\

I can't even get the swipe to work with anything.  I have a blank scene.. then just have one event that uses the event 'when swiped right' create actor.. I can't even get the actor to be created via swipe..

« Last Edit: July 06, 2013, 04:35:05 pm by henson802 »

setz

  • Posts: 7
i have been trying to figure this out too and cant. any luck since you posted?

jfraser

  • *
  • Posts: 19
Even though it is written in Stencyl 2,  all the blocks they used are in Stencyl 3.  Just set up one [when creating] and 3 [multi-touch] and fill them with

dgcharlston

  • Posts: 60
I used the above and it worked except when I released it was bugging out. If anyone has any suggestions let me know.

 Also i included Y axis because I wanted to move around in all directions (over the top game)

cvaughn55

  • Posts: 17
IS this suposed to be a Scene Behavior or an Actor Behavior