我将如何处理这件事?我可以给你看我的一些代码。但基本上我猜我必须保存字符串或其他东西。任何提示将不胜感激。我希望它出现在另一个场景中。
.h 文件
int _score;
int _oldScore;
CCLabelTTF *_scoreLabel;
@property (nonatomic, assign) CCLabelTTF *scoreLabel;
.m 文件
_score = 0;
_oldScore = -1;
self.scoreLabel = [CCLabelTTF labelWithString:@"" dimensions:CGSizeMake(100, 50) alignment:UITextAlignmentRight fontName:@"Marker Felt" fontSize:32];
_scoreLabel.position = ccp(winSize.width - _scoreLabel.contentSize.width, _scoreLabel.contentSize.height);
_scoreLabel.color = ccc3(255,0,0);
[self addChild:_scoreLabel z:1];
if (_score != _oldScore) {
_oldScore = _score;
[_scoreLabel setString:[NSString stringWithFormat:@"score%d", _score]];
}