Pinch, Spread, Rotate
slinky1988
Member, PRO Posts: 89
Best Answers
-
RThurman Posts: 2,881Made the following demo for someone on the forums last February (But I can't seem to find the thread either.) It's not built quite the same way as your video, but it might be useful.
http://www.mediafire.com/download.php?t0y2dchftm24378
Answers
Thanks! It worked perfectly and I was able to set it up how I wanted it!
GameSalad is a pretty awesome tool. It really frees up the creativity when you don't need to worry about coding and syntax!
RThruman
just a question > how would you go about getting a max size the actor can be scaled too? I tried to work it out but having some issues.
Thanks,
Nick
just added 2 integers which set W/H then created rule to only update self.size when less than max size i wanted
thanks again for the template!
Then you can use the "min" function to designate that the actor is not to get larger than the original width (and/or height).
So... in the zoom in/out group, you would modify the constrains to use the "min" function like this:
Constrain Attribute: self.Size.Width To: min( self.maxWidth ,magnitude( game.Touches.Touch 1.X - game.Touches.Touch 2.X , game.Touches.Touch 1.Y - game.Touches.Touch 2.Y )- self.WidthOffset )
Constrain Attribute: self.Size.Height To: min( self.maxHeight ,magnitude( game.Touches.Touch 1.X - game.Touches.Touch 2.X , game.Touches.Touch 1.Y - game.Touches.Touch 2.Y )- self.HeightOffset )
when you scale actors which are not square (width and height are different) the actor starts to get squished and not stay in the correct proportions.
Thank you very much
http://www.mediafire.com/download.php?7rdvhu4m377kgtq
Im testing that template. But this is only for do pinch zoom with one image, really? dont its the wat to do it for a game like angry birds?
Then we can use this behaviors for camera size.. for its anyway to test it?
We can´t test two fingers or zoom effect with trackpad or something?
But it does not sound like this is the demo you were hoping to find. I will try to answer your questions.
1) Yes, this demo is for pinch, zoom, and rotate for one image. It does not demonstrate how to zoom or rotate the camera.
2) Similar techniques could be used for pinching, zooming, and rotating the camera.
3) I can't answer if you can use this demo with a trackpad. (I don't have one.) If you test it with a trackpad and it does not work, the the answer is probably 'no'. It was created (and tested) to be used on an IOS device.
Try studying the techniques contained in this demo, then see if you can transfer the ideas for use on the camera.
I`m testing two way for pinch zoom but i dont like it. Dont feels very good
min(960,max( scene.Camera.Size.Width +(magnitude(abs( game.Touches.Touch 2.X - game.Touches.Touch 1.X ),abs( game.Touches.Touch 2.Y - game.Touches.Touch 1.Y ))/5)))
Or that
max(480,min( game.MaxWid ,magnitude( game.Touches.Touch 1.X - game.Touches.Touch 2.X , game.Touches.Touch 1.Y - game.Touches.Touch 2.Y )))
With constrain or change attribe, for width and height, but dont feel good....
I don't feel good when you don't feel good!
What would make you feel good?
https://www.dropbox.com/s/6gh886v6n0smjlj/PinchZoomRotate.gameproj.zip
http://forums.gamesalad.com/discussion/52494/spare-code-dump-it-here/p2
Perhaps it will be useful for you.
Finally i dont want to use zoom cam pinch mode on my game because i want to make more action and dont stop willl the camera makes zoom in/out.
Thank you!!