1. itemfromstring: Target: selector: Method of ccmenuitemfont. This method has been deprecated.]
The new method is as follows:
Java code
- Ccmenuitem * gamesettings = [ccmenuitemfont itemwithstring: @ "set" target: Self selector: Nil];
2 cctransitionshrinkgrow and other objects, originally named after ccxxxtransition, And now changed to cctransitionxxx. For example:
Version 1.0 or later
Ccshrinkgrowtransition cctransitionshrinkgrow
Ccslideinrtransition cctransitionslideinr
Ccslideinrlransition cctransitionslideinl
3. The ccbitmapfontatlas object is useless. It is renamed as cclabelbmfont.
Usage before 1.0:
Java code
- Ccbitmapfontatlas * lbscore = [ccbitmapfontatlas bitmapfontatlaswithstring: @ "Time: 0" fntfile: @ "font09.fnt"];
Version 1.0 and later usage:
Java code
- Cclabelbmfont * lbscore = [cclabelbmfont labelwithstring: @ "Time: 0" fntfile: @ "font09.fnt"];
4. The ccspritesheet object is gone and changed to ccspritebatchnode.
Usage before 1.0:
Java code
- Ccspritesheet * Mgr = [ccspritesheet spritesheetwithfile: @ "flight.png" Capacity: 5];
Version 1.0 and later usage:
Java code
- Ccspritebatchnode * Mgr = [ccspritebatchnode batchnodewithfile: @ "flight.png" Capacity: 5];
5. The animationwithname method of ccanimation has been deprecated and changed to animationwithspriteframes.
Original usage:
Java code
- Ccanimation * animation = [ccanimation animationwithname: @ "flight" Delay: 0.2f];
Version 1.0 and later usage:
Java code
- Cctexture2d * texture = [[cctexturecache sharedtexturecache] addimage: @ "flight.png"];
- Ccspriteframe * frame = [ccspriteframe framewithtexture: texture rect: cgrectmake (0, 0, texture. contentsize. Width, texture. contentsize. Height)];
- Nsarray * array = [[nsarray alloc] initwithobjects: frame, nil];
- Ccanimation * animation = [ccanimation animationwithspriteframes: array delay: 0.2f];
Version update problems:
An error, such as the title, occurred during compilation.
Java code
- + (ID) layerwithcolor :( cccolor4b) color
- {
- Return [[[self alloc] initwithcolor: Color] autorelease];
- }
At the beginning, it was a search error. I found a lot of solutions in English, including the famous Tom overflow forum, but there was no result. Later I saw the results from my friends on this forum, I think it's a matter of siblings.
11l Great God provides a solution
Add (colorlayer *) before [self alloc] as follows:
Java code
- + (ID) layerwithcolor :( cccolor4b) color
- {
- Return [[(colorlayer *) [self alloc] initwithcolor: Color] autorelease];
- }
In the new version of cocos2d, The colorlayer is updated to cccolorlayer or cclayercolor. The two are the same.
Reprinted from: http://lizi07.iteye.com/blog/1517652