2
我一直在尋找使背景重複在垂直方向,但總是有一些閃爍,使垂直方向的背景重複..如何使用視差
我搜索了護目鏡了很多,一些書以供參考,但不能找到一個妥善的答覆 有很多關於背景重複正確的回答對水平方向
-(void) update:(ccTime)delta
{
CCSprite* sprite;
CCARRAY_FOREACH([spriteBatch children], sprite)
{
NSNumber* factor = [speedFactors objectAtIndex:sprite.zOrder];
CGPoint pos = sprite.position;
pos.y -= scrollSpeed * [factor floatValue] * (delta * 50);
if (pos.y < -screenSize.height)
{
pos.y += (screenSize.height * 2) - 2;
}
sprite.position = pos;
}
}
嗨,日Thnx快速回復... 我最關心的是我想要的背景重複頂部向在垂直方向下... 我試過你的鏈接,但背景重複從左到右 我改變x和y,但它沒有工作 – Drake 2013-04-10 08:15:30
ok ..update d我的答案.. – Guru 2013-04-10 09:12:22
嗨,謝謝你這麼好的回覆.. 一個問題通過..而上下的屏幕顯示空白每次...你可以看到背景空.. – Drake 2013-04-10 09:21:57