Hi all, I want to make use of the multitouch/pinch zoom feature to allow the player zoom in and out of the level. IE. The level will be 2 screens wide and 2 screens high.
Problem I am having, is that my physics bodies are not scaling with the images… so for example, the physics body for my terrain is no longer correctly scaled/positioned in relation to the image the player is seeing! And I would like the player to be able to take his next shot from his current view… be that zoom 100% or 50%!
I am not keen on removing and adding physics bodies each and everytime I zoom… and because I am using complex shapes, it could open a can of worms!
Is there an easier way!!! Why cant the physics body scale with the image?
Example. Add the last 2 lines of code to the eggbreaker example and turn physics to hybrid view.
[code]
– Launch boulder
local boulder = display.newImage( “boulder.png” )
game:insert( boulder )
– initial body type is “kinematic” so it doesn’t fall under gravity
physics.addBody( boulder, { density=15.0, friction=0.5, bounce=0.2, radius=36 } )
boulder.xScale = 0.5
boulder.yScale = 0.5
[/code] [import]uid: 12583 topic_id: 20785 reply_id: 320785[/import]
[import]uid: 52491 topic_id: 20785 reply_id: 81826[/import]