Pinch, Spread, Rotate

slinky1988slinky1988 Member, PRO Posts: 89
edited June 2012 in Working with GS (Mac)
Is there a tutorial to do this? I've tried searching the forums and looking on tshirtbooth youtube video but I can't seem to find anything.

An example of what I'm trying to achieve:


Thanks in advance!

Best Answers

Answers

  • slinky1988slinky1988 Member, PRO Posts: 89
    Thanks! I'll mess around with it now!
  • slinky1988slinky1988 Member, PRO Posts: 89
    @RThurman

    Thanks! It worked perfectly and I was able to set it up how I wanted it!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @uptimistik -- Thanks! You just made my day!
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    @RThurman thanks man, it's amazing! I wouldn't be able to do this myself!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @TheMoonwalls -- Thanks! Its been so long since I did that demo that I need to think carefully about how to do it myself! I'm sure its just a permutation of something FMG, Orbs, or TSB (or some other GS guru) has already done.

    GameSalad is a pretty awesome tool. It really frees up the creativity when you don't need to worry about coding and syntax!

    RThruman
  • nikkonnikkon Member, PRO Posts: 111
    Just found this demo. Its exactly what i was after thanks :)

    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
  • nikkonnikkon Member, PRO Posts: 111
    nevermind worked it out :)

    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!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    One way of limiting the max size would be to create two new attributes (maxHeight, maxWidth). Then at the top of the behavior list, use two change attribute behaviors to specify the the maximum. (For example, you could set the maximums to the actor's current size.)

    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 )
  • nikkonnikkon Member, PRO Posts: 111
    Just another issue I'm trying to work out >

    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.
  • mrpacogpmrpacogp Member Posts: 400
    Made 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
    Could you reupload that?
    Thank you very much
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited December 2012
    Here you go. Sorry about the large size. Its got a big unoptimized graphic in it.

    http://www.mediafire.com/download.php?7rdvhu4m377kgtq
  • mrpacogpmrpacogp Member Posts: 400
    edited December 2012
    Thank you very much for share!
    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?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @mrpacogp -- You are welcome!

    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.
  • mrpacogpmrpacogp Member Posts: 400
    Let me try this another time.
    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....
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @mrpacogp
    I don't feel good when you don't feel good! :(

    What would make you feel good? :D
  • mrpacogpmrpacogp Member Posts: 400
    I`m trying to make your project for pinch zoom cam
    https://www.dropbox.com/s/6gh886v6n0smjlj/PinchZoomRotate.gameproj.zip
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    This thread is about resizing/rotating actors. I would suggest you start a new thread about pinch/zoom/rotating the camera. (There might be others who are interested in camera manipulation!)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @mrpacogp -- I put a demo file for camera pinch/rotate in this thread:
    http://forums.gamesalad.com/discussion/52494/spare-code-dump-it-here/p2

    Perhaps it will be useful for you.
  • mrpacogpmrpacogp Member Posts: 400
    Thank you very much for remember my problem.
    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!!
Sign In or Register to comment.