If you are using physics editor for making physics objects in your corona game, then at some point you may doubted about how to scale the physics area according to the sprite scale values... But it is very simple.
For doing such alternation, there is
And when you change the scaleFactor, the size of physics area will automatically change.
For doing such alternation, there is
scaleFactor
provided. You can assign physics to the object with this scale factor, as below: local scaleFactor = 1.0
local physicsData = (require "shapedefs").physicsData(scaleFactor)
local shape = display.newImage("objectname.png")
physics.addBody( shape, physicsData:get("objectname") )
And when you change the scaleFactor, the size of physics area will automatically change.
No comments:
Post a Comment