Scaling physics objects

How do you change the scale of a physics object?

1
2
3
4
local body = display.newCircle( 0, 0, 10 );
body:setFillColor ( 255, 0, 0, 0 );
display.getCurrentStage():insert(body);
physics.addBody( body, "static", physicsData:get("myBody") );

@jn19,
scaling and reversing a physics body are two different things. Even with a 2D image, scaling means changing the size, with -1,1 you are flipping it.

In the case of the Physics body, when you say reverse it, you mean reverse the gravity or the image of the physics body? In your case it is a circle, how do you reverse a circle? So it must be the gravity that you want to reverse.

cheers,

?:)

Yes, but notice that the circle has an alpha of zero - you don't see it. What I'm concerned with is the associated custom physics body. I just want to "flip" it. Think of a cat facing left - I want it to face right.

views:1744 update:2011/9/29 9:22:17
corona forums © 2003-2011