iPhoneアプリ開発講座を受講する その10 & RoR3献本きた
CCLabelAtlasについて
下の画像の左上にある数字。こいつを表示する。
画像で数字を用意するんだけど、決められた順で用意しておく必要があるそうな。
ラベルの準備
CCLabelAtlas scoreLabel_=[CCLabelAtlas labelWithString:@"000" charMapFile:@"texture/fontGameScore.png" itemWidth:19 itemHeight:23 startCharMap:'0']; [scoreLabel_ setAnchorPoint:ccp(1, 1)]; [scoreLabel_ setPosition:ccp(460, 310)]; [self addChild:scoreLabel_]; [self schedule:@selector(countUp:)];
数字をカウントアップしてみる
-(void)countUp:(ccTime)dt { count_+=1; NSString *str = [NSString stringWithFormat:@"%d",count_]; [scoreLabel_ setString:str]; }
RoR3
Rubyなんて、redmineをいじるときに少し触る程度で、まともにやったことがない。
でも献本きたし、丁度よい機会なのでレビューついでに、やってみようかなと思う。