playMaker

Author Topic: Swipe to Navigate Camera + Limitations  (Read 4529 times)

fiorentin

  • Playmaker Newbie
  • *
  • Posts: 2
Swipe to Navigate Camera + Limitations
« on: June 29, 2013, 11:06:40 AM »
Hello,

Im developing a 2d game for ios (ipad) and Im thinking on moving from Gamesalad to Unity (so im kind of evaluating unity/playmaker right now to see how hard it is to acheive what i want). The main scene is mainly made up of one big background image were the rest is put in front of it like layers in photoshop. I only want the camera (orthographic) to see a part of the scene, the rest is up to discover - as you swipe the camera moves around the scenes X and Y axis.

So long so fine. I took a look at the Swipe Gesture tutorial and used that without the dice function. However, and this is where im stuck. I want the camera to stay inside of the scene. So if you swipe to right and "hit" the scenes right border you wont be able to swipe to right again. Only up, down and left.

I believe there must be some kind of easy (or not that advanced) solution for this, im not just sure where to start.

Any help on this would be much appreciated! 

Kindly
F

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Swipe to Navigate Camera + Limitations
« Reply #1 on: June 29, 2013, 10:39:48 PM »
Hi, I was developing a camera system for my game before I put it on hold .. it was getting pretty advanced though.

There are a bunch of ways to limit the position of the camera but it depends on what type of feel you want - Do you want a hard stop or a smooth spring back?

The easiest way I could think of would be to test if the position is more than the boundary and if so set it to the boundary. but that would give you a solid boundary and for me feels poo!

fiorentin

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Swipe to Navigate Camera + Limitations
« Reply #2 on: July 01, 2013, 05:17:41 AM »
Hi,

I kind of like the way you scroll the camera in games like Angry Birds and Icebreaker. A horizontal scroll were you can both swipe and drag the camera. I found Jeans Clamped drag post and maybe that should do it. Only needs to be translated into touch instead of mouseaction.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Swipe to Navigate Camera + Limitations
« Reply #3 on: July 02, 2013, 02:18:37 AM »
Hi,

 moving from mouse position to touch position should be fine, if you have problems, don't hesitate to come back to me.

bye,

 Jean