我正在尝试使用字符串数组使 CCLabelTTF 每 10 秒更改一次其文本。这是我到目前为止的代码,但它给了我这个错误!
2013-09-07 15:47:34.618 MazeIt[6271:1b503] -[TitleLayer opacity]: unrecognized selector sent to instance 0xa553bb0
如果在 runAction 和 CCLabel 方面更有经验的人可以帮助我,那将非常有帮助!
这是我拥有的代码:我有 _list 是字符串数组, _text 是我想要操作的 CCLabelTTF
In init _text and _list is created:
[self schedule:@selector(callback) interval:10.0f];
-(void) callback
{
id fadeIn = [_text runAction:[CCFadeTo actionWithDuration:0.5 opacity:127]];
id fadeOut = [_text runAction:[CCFadeTo actionWithDuration:0.5 opacity:255]];
id change = [CCCallFunc actionWithTarget:_text selector: @selector(changeText:)];
id sequence = [CCSequence actions: fadeIn, change, fadeOut, nil];
[self runAction: sequence];
}
- (void)changeText:(id)sender{
[_text setString:@"You completed no levels!"];
// [_text setString:_list[0]];
// [_text setString:_list[_next%[_list count]]];
_next++;
}
谢谢!!!