0
\$\begingroup\$

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!

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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