playMaker

Author Topic: Mobile "standard scrolling" by finger guestures  (Read 3102 times)

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Mobile "standard scrolling" by finger guestures
« on: May 27, 2013, 11:50:40 AM »
One should think it is so standard that it is amazing it is not there:

You move your finger, the camera moves, you scroll.

It's so standard, if you should happen to read this text on a smart phone, you will have to scroll down to read..




...this ;)

Angry Birds has it, tons of "standard" 2D games have it.. but it appears to be very hard to do with Playmaker. (I have not managed so far)

The reason is that since the finger gestures react on the main camera, you get a strange infinite loop, the input makes new input..

It is of course possible to move the world, not the camera - but then physics is a mess ;)

It'd be truly awesome to just be able to scroll the camera, and if it would have little "softies" build in, so fast moves would make the scroll continue for a bit - while it's still possible to "catch" the scroll, and do it the other way.. then I have no words for how awesome that would be :D

Cheers, you guys are doing a fantastic job!!


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Mobile "standard scrolling" by finger guestures
« Reply #1 on: May 28, 2013, 02:09:59 AM »
Hi,

 It's impossible to cover all cases, that's why Unity and PlayMaker are so good, they provide building block for your achieve what ever you want.

 in your case, where is your struggle? moving the camera or the softness of the camera movement? maybe the touch input management?

 typical way out of this. Instead of animating your camera, animate an empty object, tjat is your touch drags the empty gameObject. Then you camery will follow that empty gameObject, and this is where you add the softnss by using an action such as "smooth follow action".

 Else, can you explain where is your issue? we'll solved it.

bye,

 Jean

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Mobile "standard scrolling" by finger guestures
« Reply #2 on: May 29, 2013, 06:10:20 AM »
One of the areas that Im having issue with, and it might be the same with FritsLyn is the release velocity of the standard iOS drag gestures seems to be based on the final few frames of the gesture (not a big deal to get the velocity of the previous few frames) its just very fidly to get it feeling just right. But as you said Jean Playmaker and Unity are build to handle what you specifically want.

When I get mine feeling just right Ill release it as a package ... once I rip out all my custom input manager.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Mobile "standard scrolling" by finger guestures
« Reply #3 on: May 31, 2013, 01:03:18 AM »
Just a small update - I have most of it working, even clamping to the left and right, just trying to get the decreased drag when you reach the limit ... I'm rather confident that its relativly easy to do.

Features
Drag scroll - 1 to 1 movement (with scaleable offset for different scene scales)
End of drag velocity - the final two frames of any drag will calculate the velocity and add some smoothing (also scaleable)
Positionable camera limits - a right and left node which defines the camera limits on awake
Both mouse and touch -  implimented for testing on PC/Mac(shared values)
Whats needed -
Decreased drag at limits - So the user can feel the limits while draging.
Re-touch to stop - While the camera is moving, any input on screen will stop the scroll.
Initial camera positioning - Incase the camera needs to start  in the last position the user was in. (provided it was stored as a PlayerPref)

Is there anything I'm forgetting? Also this using only default actions.

Will clean it up and release it soon.
« Last Edit: May 31, 2013, 01:05:01 AM by LampRabbit »