Page 1 of 1

cpBB confusion (CGRect relationship)

Posted: Sun Jan 11, 2015 3:42 pm
by dugbug
Hi, with v7 objective-chipmunk users have to use cpbb instead of cgrect when using [space addSpace] but cpbb is not explained very well. It takes four arguments but what they reference is not clear: left, bottom, right, and top.

I get a single field called .... 'left'? what is left, distance from the center? For some reason I landed on this combination that seems to work but would appreciate confirmation from anybody that has done this.

cpbb.l = bounds.origin.x;
cpbb.b = bounds.origin.y;
cpbb.r = bounds.size.width;
cpbb.t = bounds.size.height;


thanks!