Camera Pinch Zoom IN Zoom OUT
carlos.varela.com
Member Posts: 99
I just did saw the camera zoom sample demo that use a "click" for Zoom IN.
http://gamesalad.com/forums/topic.php?id=6734#post-43835
But, have you any idea of implement this with multitouch like apple's pinch zoom effect?
I like so much the way like angry birds and other games use the "pinch" (Two fingers) effect.
I really does not have any idea of how to deal with multi-touch in gs, by other way the that I did saw like joystick sample demo, just track the touches on some areas, but in this case you to cover all the background of your camera view.
I am using the sample scroll demo on my game, but I need to extend the functionality to be able to zoom IN and OUT too, preferred using "pinch" effect, because is an standard procedure on this apple's devices.
http://gamesalad.com/game/play/51398
Any idea?
http://gamesalad.com/forums/topic.php?id=6734#post-43835
But, have you any idea of implement this with multitouch like apple's pinch zoom effect?
I like so much the way like angry birds and other games use the "pinch" (Two fingers) effect.
I really does not have any idea of how to deal with multi-touch in gs, by other way the that I did saw like joystick sample demo, just track the touches on some areas, but in this case you to cover all the background of your camera view.
I am using the sample scroll demo on my game, but I need to extend the functionality to be able to zoom IN and OUT too, preferred using "pinch" effect, because is an standard procedure on this apple's devices.
http://gamesalad.com/game/play/51398
Any idea?
Comments
I guess you could use touch 1 and 2. Get their X and Y coordinates and and calculate the distance between them. If it is an increasing function then zoom in, if decreasing zoom out. Calculating the distance would be easy and i guess you could check whether it has increased or decreased every 0.1 seconds with a timer. There is a smoother way I'm sure, FMG had a thread a while ago about whether a scroll was clockwise or anti-clockwise and I'm sure the solution could be manipulated for this purpose.
I'll check it out now if I can find it.
; )P too
Have two touches... touch1 and touch2
You could place an actor at each touch position, so wherever you touch the screen the actors get placed there. Then constrain each actor to touch1 and touch2. Then check to see if the actors are being dragged towards each other and if so zoom in, if they are being dragged away from each other zoom out.
I will do a sample later if i get time.
Please, can you take a look to this sample:
http://gamesalad.com/game/play/51398
I am using this code for my own scroll. I have been trying to adapt it in order to zoom in/out, but nothing yet : (
http://gamesalad.com/game/play/79393