Touch and dragging help needed

SquareHeartSquareHeart Member, PRO Posts: 69
edited November -1 in Working with GS (Mac)
I have a map (in my pause screen) which I want players to be able to touch and drag around to view and pinch/zoom. Now, surprisingly, I got the pinch zoom up and running pretty easily but am struggling with the touch-to-drag-the-map-around behaviour.

my current setup is that touch to drag and pinch zoom - scale and move an actor around (rather than control the camera).

My problem is this - if I constrain the actor to touch.x (it only needs to move horizontally) - on touch it snaps the actors origin to my touch. the behaviour i'm after is the player - touches then drags , lifts his finger then touches and drags (repeat forever) - imagine shuffling your way around a large image on the iphone -same deal.
I thought I could do this expression -
constrain scene.Map.x (my map's self.position.X exposed) to ----> `game.touches.touch1.x - magnitude (game.touches.touch1.x-scene.Map.x, 0)`

basically take the maps position - find the difference between the touch and maps position and subtract that from the touch position - which , I thought would constrain the map to the players touch without it snapping to the touch position.

gerp! went I try this it just locks the map and makes it non-interactive.
Any clues to solve this conundrum?
Sign In or Register to comment.