0
votes

I have a circular shaped sprite. And I don't want to use Box2d physics mechanism i.e creating body and getting the radius.

Is there any mechanism in cocos2d to detect that a sprite is circular in shape and from that we can get the radius of the sprite programmatically?

Thanks.

1

1 Answers

0
votes

If you simply create your CCSprite without setting frame width and size but rather, just using the name of the image file, can't you simply just get the CCSprite's frame.bound ?

Given that your sprite is circular in shape (perfect circle I assume), then your circle's radius is essentially your box's width or height (again, I assume a perfect circle).