I have created a label with left alignment and I want the label to start a certain position (x,y) as below;
CCLabelTTF *lblHeader = [CCLabelTTF labelWithString:@"New game" dimensions:CGSizeMake(250, 25) alignment:UITextAlignmentLeft lineBreakMode:UILineBreakModeClip fontName:@"Georgia" fontSize:18];
[lblHeader setPosition:CGPointMake(105, 275)];
But if I change the contents of the label to:
New game > Color scheme
The position of the label is now in a different place, and it seems to put things based off the center, even though the alignment is left.
How do I force a label (regardless of whether its bitmap or not) to start at the position specified?
I tried anchor points;
[lblHeader setAnchorPoint:CGPointMake(0.5, 0.5)];
But this seems to make no difference.
I also changed the dimensions to
Which seems to solve the problem, but I don't understand why making the dimensions wider would suddenly start positioning things further left.
What I'd like to know, therefore, is how:
1. Make a label start at position x,y but have dimensions that strictly start at position x,y.