It's very easy to Left-Align CCLabelTTF, but CCButton seems to have a problem with alignments.
setting button.horizontalpadding = CCTextAlignmentLeft;
has no affect on button alignment.
I have attempted to modify properties preferredSize
and contentSize
in order to create boxes for alignment without success.
I dont this there is a CCButton class in cocos2d. I assume you are talking about CCMenuItelLabel. Try this way:
CGPoint rightAlligned = ccp(1.0f, 0.5f);
CGPoint leftAlligned = ccp(0.0f, 0.5f);
button.label.anchorPoint = leftAligned; //For left text align
button.label.anchorPoint = rightAligned; //For right text align