Voici un moyen possible:
Ce code est dans une classe simple scène:
// on "init" you need to initialize your instance
-(id) init
{
// always call "super" init
// Apple recommends to re-assign "self" with the "super's" return value
if((self=[super init]))
{
// create and initialize a Label
CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64];
// ask director for the window size
CGSize size = [[CCDirector sharedDirector] winSize];
// position the label on the center of the screen
label.position = ccp(size.width /2 , size.height/2);
// add the label as a child to this Layer
[self addChild: label];
}
return self;
}
L'espoir peut vous aider!
Voulez-vous dire Cocoa ou http://code.google.com/p/cocos2d-iphone? – progrmr