CCLabelTTF *label = [CCLabelTTF labelWithString:@"Score : #" fontName:@"Arial" fontSize:14];
// ask director the the window size
CGSize size = [[CCDirector sharedDirector] winSize];
// position the label on the center of the screen
label.position = ccp( size.width + 0, size.height + 0 );
// add the label as a child to this Layer
[self addChild: label];
label.position = ccp( size.width + 0, size.height + 0 );
how would i get that label in the bottom left corner. I do not understand the coordinates system very well. From what I understand Y is bottom. X is far left. so how come when I use that code, the position of the label is top right. My application is portrait.
Also would it better to have the label as a sprite, or just keep it like that. ( its to hold a score )
In codos2d, the point (0,0) is the bottom left corner of the screen. Think of it as quadrant 1 on a x,y plane where x increases as you go right, and y increases as you go up.
So to get the label in the bottom left just do
label.position = ccp(0, 0);but this might be the default so you might not have to do anything.