how to scale down whole scene like Angry Bird?

Hello,
How do you scale all the objects in a scene by two fingers (multitouch) like in the game Angry Bird? I already read the example PinchZoomGesture but that is not involved in physics. I think of using a group to put all the objects in it and then use group.xScale and group.yScale to scale all objects down, the display objects are scaled down but the physics bodies are not scaled down. Any suggestion? I just wonder how did they do this in Angry Bird?

Try using physics.setScale( number ). You'll have to play with the exact value to get it right for your game, so the "hybrid" or "debug" draw mode should come in useful for you as well:

physics.setDrawMode( "hybrid" )
physics.setDrawMode( "debug" )

According to the document, physics.setScale() "should be done only once, before any physical objects are instantiated". So after a multitouch, you can't set it again. In addition, changing this value has no visual consequences, and simply affects the accuracy of the physical model. So the objects' visual display will not scale down.

views:1434 update:2011/10/18 15:01:22
corona forums © 2003-2011