Custom shape need better explanation

From the API :

Polygon bodies  
  
General polygonal bodies that don’t fall into the above two special cases are generated with a “shape” parameter, which is used to pass a Lua table of (x,y) coordinate points that outline the collision boundaries. These coordinates are specified relative to the display object: by default, Corona sets the origin of a display object at the center of the corresponding image file (or vector object).  
  
For example, to define a rectangular shape 20 pixels high and 40 pixels wide, with its origin at its center, the following shape definition would be used:  
  
squareShape = { -20,-10, 20,-10, 20,10, -20,10 }  

what are the values contained in the square shape ? x, y, w, h …??

If someone would post this up it would be most helpful, it really should be in the api also [import]uid: 6981 topic_id: 4768 reply_id: 304768[/import]

The shape’s definition is made of x,y coordinates around a local axis. The example starts at the upper left corner (-20,-10) and defines the other 3 corners to make a rectangle 20x40 pixels big. (You can start at any corner as long as you go in a clockwise direction). So, squareShape = {x1,y1,x2,y2,x3,y3,x4,y4}, where each x,y pair is a corner of the shape and the origin, 0,0, is inside the center of the rectangle. You can define up to 8 points per shape. Multiple shapes can be combined to define more complex objects. [import]uid: 9422 topic_id: 4768 reply_id: 15267[/import]

Thanks :slight_smile: [import]uid: 6981 topic_id: 4768 reply_id: 15291[/import]