10
I am making one game in which i am facing problem when I test my App on Device(iPhone4) the background of it is not working. Like when background image ends BLACKISH BACKGROUND COLOR comes. My Background image size is 460X2880,image name "mars_sample.jpg" (for iPhone4) And code for Background Moving is :
-(void)backgroundmoving:(ccTime)dt
{
static float bk_f=0.0f;
bk_f -=0.9;
if (bk_f <= -960*3) {bk_f=0;}
background.position = ccp( 0,bk_f);
}
When I am loading "460X2880" size image as Background image then it doesn't loads in background AND if it is like of size "460X1192" it loads image in background but Showing BLACKISH BACKGROUND Color on Top of screen.
Below one CODE is for Setting Background image :
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
background = [CCSprite spriteWithFile:@"staripad.png"];
background.anchorPoint= ccp(0,0);
[self addChild:background z:0];
} else {
background = [CCSprite spriteWithFile:@"mars_sample.jpg"];
background.anchorPoint= ccp(0,0);
[self addChild:background z:0];
[self schedule:@selector(backgroundmoving:) interval:1/30];
}
Please Give me some suggestions, how it will work. Thanks ALL
Regards,
Tauseef Khan