Polygon Regions

First: What's the code for create a polygon region? I can't find it.

Second: Let's split this into parts.

1. Code to start the polygon.
2. Code to add a point to the polygon.
3. Code to close the polygon.
4: Code to move a specific point in the polygon.

Greg

  • *
  • Posts: 1259
It's not really that easy right now.  You'd have to call this

Code: [Select]
private function createRegion(x:Number, y:Number, shape:b2Shape, offset:Boolean=false):Region

But you'd need to create a Box2d polygon shape first and pass that in.  There's no formal methods for creating or adding points.