Problem of Sprites and labels are displayed by white boxes.

Posted by srikanth rongali on Stack Overflow See other posts from Stack Overflow or by srikanth rongali
Published on 2010-06-17T12:09:37Z Indexed on 2010/06/17 12:13 UTC
Read the original article Hit count: 256

Filed under:
|

I am writing a game in cocos2d. I am using a function restartDirector in AppDelegate class. -(void)restartDirector{

[[CCDirector sharedDirector] end];

[[CCDirector  sharedDirector] release];

if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] )
[CCDirector setDirectorType:CCDirectorTypeDefault];

[[CCDirector sharedDirector] setPixelFormat:kPixelFormatRGBA8888];
[CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];

[[CCDirector sharedDirector] setAnimationInterval:1.0/60];
[[CCDirector sharedDirector] setDisplayFPS:YES];
[[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];

[[CCDirector sharedDirector] attachInView:window];

}

This function I called in one of the game Scene .

-(void)PracticeMethod:(id)sender
{
[MY_DELEGATE restartDirector];

CCScene *endPageScene = [CCScene node];
CCLayer *endPageLayer = [DummyScene node];

[endPageScene addChild:endPageLayer];

[[CCDirector sharedDirector] runWithScene:endPageScene]; 

//  [[CCDirector sharedDirector] replaceScene:endPageScene];
}

When used the replaceScene, there is no problem in game but the memory of abject allocation is high(I checked in leaks tool). So I used runWithScene. But , while using these when the scene DummyScene is loaded the sprites, labels in it are displayed by white boxes. I cannot see the sprites and labels. If I am using replaceScene everything thing is working fine but the memory allocation is high. this is my problem.

alt text

Thank you.

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about cocos2d-iphone