If you are using Cocos2d v3.0 it's not yet developed. In v3.1 it's neither included, maybe in future releases.
cocos2d v3 CCPhysicsBody cornerRadius
-
14-06-2023 - |
Question
I try to create a CCPhysicsBody with a cornerRadius but I can't make it work. Here my code :
CCSprite * player = [[CCSprite alloc] initWithImageNamed:@"ship.png"];
player.position = ccp(200, 100);
player.physicsBody = [CCPhysicsBody bodyWithRect:(CGRect){CGPointZero, player.contentSize}
cornerRadius:5.0f];
player.physicsBody.collisionGroup = @"playerGroup";
player.physicsBody.collisionType = @"playerCollision";
[physicsWorld addChild:player];
I tried several values (1, 30, 10.0f ....) without effect.
When I use physicsWorld.debugDraw = YES;
the corners are never rounded.
Am I missing something ?
Thanks.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow