我想在我的项目中使用以下代码行。
// 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?如果是,我应该用什么代替他们。请帮忙。