How to get the radius of a circular image?

Unfortunately, Corona’s physics engine cannot auto-detect circular images and then add the proper physics shapes to them, we have to use the “radius” property to do that.

I have an image of an oval shape, which I know nothing about except its width & height, which is (68, 45) so how would I go about adding a proper circular body to it?

Oval body, not circular.

These are your options:

In any case, this oval body will only be an approximation.  Box 2D (the physics engine Corona uses) supports:

  • Circular bodies (not oval).
  • Squares (4 vertex subset of following)
  • Arbitrary convex bodies with up to 8 vertices

In short, 8 verticies isn’t enough for a smooth shape.

Don’t forget to verify the body visually by setting the draw mode to hyrbrid to see that your approximation of an oval lines up.

Oval body, not circular.

These are your options:

In any case, this oval body will only be an approximation.  Box 2D (the physics engine Corona uses) supports:

  • Circular bodies (not oval).
  • Squares (4 vertex subset of following)
  • Arbitrary convex bodies with up to 8 vertices

In short, 8 verticies isn’t enough for a smooth shape.

Don’t forget to verify the body visually by setting the draw mode to hyrbrid to see that your approximation of an oval lines up.