Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a CCLabelTTF in the top right hand corner of the view.

-(void)scrollScoreLabelAndMonkey{
scoreLabel = [CCLabelTTF labelWithString:@"0000" fontName:@"Marker Felt"   
fontSize:30 ];
scoreLabel.position=ccp(420,300);
scoreLabel.color = ccGREEN;
[self addChild:scoreLabel];
}

I simply add this code to the bottom of the above method. However as soon as i add this line, the label doesnt show up at all.

id moveScore = [CCMoveBy actionWithDuration:.7 position:ccp(scoreLabel.position.x + 10, 0)];
CCRepeatForever *scrollScoreLabel = [CCRepeatForever actionWithAction:moveScore];
[scoreLabel runAction:scrollScoreLabel];

Any help is greatly appreciated!

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

The problem is that you are moving the label to the right (420+10 points). I don't know what do you want to achieve with this action but basically you are continuously moving the label to the right. If you don't understand, change the duration of the animation to something like 2 and you will see the problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.