While that works, you'll have the same problem if the score goes above 1000.
You can use the anchorPosition
property to change where the position is defined. For example; in my game I place the scoreLabel
in the lower right hand corner of the screen. To ensure it is always visible I set anchorPosition
to be the lower right hand corner of the label and then set its position
where I want the lower right hand corner of the label to be.
[scoreLabel setAnchorPoint:ccp(1, 0)];
[scoreLabel setPosition:ccp(480, 0)];
If you want it positioned in the upper right hand corner of the screen then you can similarly use the following code to define the anchor as the upper right corner.
[scoreLabel setAnchorPoint:ccp(1, 1)];
[scoreLabel setPosition:ccp(480, 320)];