Is there a way in cocos2d 0.7.1 to specify the text alignment in a LabelAtlas?
I’m using a LabelAtlas for a score (displayed in the upper right corner) but when the score goes above 10, the second digit is cut off.
I can implement code to detect that and move the LabelAtlas, but is there a way to have cocos2d do it for me?
Thanks.
While that works, you’ll have the same problem if the score goes above 1000.
You can use the
anchorPositionproperty to change where the position is defined. For example; in my game I place thescoreLabelin the lower right hand corner of the screen. To ensure it is always visible I setanchorPositionto be the lower right hand corner of the label and then set itspositionwhere I want the lower right hand corner of the label to be.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.