1
我想在我的项目中使用以下几行代码。使用setDelay和addFrameWithFilename时的警告
// Create the intro image
CGSize screenSize = [CCDirector sharedDirector].winSize;
CCSprite *introImage = [CCSprite spriteWithFile:@"intro1.png"];
[introImage setPosition:ccp(screenSize.width/2, screenSize.height/2)];
[self addChild:introImage];
// Create the intro animation, and load it from intro1 to intro7.png
CCAnimation *introAnimation = [CCAnimation animation];
[introAnimation setDelay:2.5f];
for (int frameNumber=0; frameNumber < 8; frameNumber++) {
CCLOG(@"Adding image intro%d.png to the introAnimation.",frameNumber);
[introAnimation addFrameWithFilename:
[NSString stringWithFormat:@"intro%d.png",frameNumber]];
我得到警告:
instance method '-setDelay:' not found (return type defaults to 'id')
指着线
[introAnimation setDelay:2.5f];
和类似的警告指着线
[introAnimation addFrameWithFilename: [NSString stringWithFormat:@"intro%d.png",frameNumber]];
拥有setDelay和addFrameWithFilename了弃用?如果是的话,我应该用什么来代替他们。请帮忙。
看看CCAnimation.h文件。 '/ **“延迟单位”的延迟秒数*/ @property(nonatomic,readwrite)float delayPerUnit;' – Kreiri 2013-03-13 19:35:24