objective-ccocos2d-iphoneatlassprites

confused re upgrading pre 0.99 Cocos2d-iPhone code to current version - AtlasSpriteManager


I have been working my way through the code pretty quickly with the help of the pre 0.99 migration guide - http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:migrating_to_0_9 - but have got stuck with the conversion of AtlasSpriteManager, AtlasSprite to CCSPrite and other objects.

I am not clear enough on what is being done or how the current system works when it invovles a Board object as well. (the examples I found didnt include it). I do know I need to convert the AtlasSprite instances into CCSprite.

Edit: Board is an implementation of CCLayer

This is an example of the code I need to upgrade:

Board *board = [Board sharedBoard];

AtlasSpriteManager *backgroundManager = [AtlasSpriteManager spriteManagerWithFile:@"cloudBoard.png" capacity:200];

 [board addChild:backgroundManager z:0 tag:BLOCK_KEY];

 background = [AtlasSprite spriteWithRect:CGRectMake(0, 0, 480, 320) spriteManager:backgroundManager];
 background.anchorPoint = ccp(0.0, 0.0);
 background.position = ccp(0, 0);

 [backgroundManager addChild:background];

thanks in advance!


Solution

  • I havne't finished the upgrade so I verify this with a sucessful runtime, however AtlasSpriteManager and AtlasSprite are both replaced with instances of CCSprite

    Edit: yes this is the answer.