Back scrolling problem

Back scrolling problem
0.0 0


Hi! I need scrolling background from single sprite.I loaded this sprite twice and have
CCSprite s1,s2;
with same image. Sprite s1 in position screenHeight * 0.5f, s2 in position screenHeight * 1.5f and i moving them from up to down whit same value dt*speed. All must be ok because height of s1 == screenHeight, but i see black line between them. How can i fix it?


I think it is because the result of screenHeight * 0.5f and screenHeight * 1.5f is not an integer. So please use an integer value. May be +1 to the result.


Thanks, I tried to manually set values as 256.0f and 768.0f but nothing has changed. I can properly load the sprites, i’m doing it this way

CCSpriteBatchNode* spreetsheet = CCSpriteBatchNode::create;
CCSprite *s1 = CCSprite::spriteWithSpriteFrameName;
>setPosition(ccp(192.0f, 256.0f));

CCSprite *s2 = CCSprite::spriteWithSpriteFrameName(“road.png”);

This is code from my init(). image.png created with TexturePacker.