cocos2dでscoreとかの更新,ようするにラベルの文字列をあとから更新ってことです。 2012/04/23

cocos2dです。
スコアとかupdateメソッドで更新とかしたい場合を想定しております。
下記参考リンク
cocos2dで文字列の更新 « なんかもう実験場
タグで検索して使うというのが自分好みかな。
はじめ

{ // score CCLabelTTF *lblScore = [CCLabelTTF labelWithString:[NSString stringWithFormat:@"SCORE:%d",0] fontName:@"Arial" fontSize:32.0]; lblScore.color = ccc3(0,0,0); lblScore.tag = 6000; CGPoint point = ccp(90, 450); lblScore.position = point; [self addChild:lblScore]; }

書き換え

CCLabelTTF *lblScore = (CCLabelTTF*)[self getChildByTag:6000]; [lblScore setString: [NSString stringWithFormat:@"SCORE:%d", スコア]];

ようやくcocos2dを使うことになれてきた感じがするなー

: