Я хочу использовать следующие строки кода в моем проекте.предупреждения при использовании 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]];
Has setDelay и addFrameWithFilename был осуждается? Если да, то что я должен использовать вместо них. Пожалуйста помоги.
Посмотрите на CCAnimation.h файл. '/ ** Задержка в секундах« единицы задержки »*/ @property (nonatomic, readwrite) float delayPerUnit;' – Kreiri