I'm having a problem :/
I have a box2d body and i have a sprite that is supposed to be in the same position as the body,On my simulator the sprite and the body line up.
The problem is that on my device the position of the sprite isn't in the same position as the body, I think it may have something to do with the devices retina display, But i don't know how to fix this, can anybody help me out? 🙂...
My other images go to there correct position, it seems to only happen with box2d Sprites..
here's some of my code,
I have a box2d body and i have a sprite that is supposed to be in the same position as the body,On my simulator the sprite and the body line up.
The problem is that on my device the position of the sprite isn't in the same position as the body, I think it may have something to do with the devices retina display, But i don't know how to fix this, can anybody help me out? 🙂...
My other images go to there correct position, it seems to only happen with box2d Sprites..
here's some of my code,
Code: Select all
[self addNewSpriteWithCoords:ccp(screenSize.width/2+15, screenSize.height/2+50)];
Code: Select all
-(void) addNewSpriteWithCoords:(CGPoint)p
{
Sprite = [CCSprite spriteWithFile:@"proto01.png"];
Sprite.position = ccp(Sprite.position.x,Sprite.position.y);
[self addChild:Sprite];
bodyDef1.type = b2_kinematicBody;
bodyDef1.fixedRotation = true;
bodyDef1.position.Set(p.x/PTM_RATIO, p.y/PTM_RATIO);
bodyDef1.userData = Sprite;
bodyDef1.linearDamping = 2.0;
bodyDef1.allowSleep = false;
body = world->CreateBody(&bodyDef1);
body->SetAngularDamping(1000);