我的应用程序中有以下代码.
我是使用COCOS在iPhone中进行游戏开发的新手.
Sprite *bg=[Sprite spriteWithFile:@"menu.png"]; [bg setPosition:ccp(240,160)]; [self addChild:bg z:0]; [self addChild:[GameLayer node] z:1]; } return self;
}
@end @implementation GameLayer -(id)init{ if(self=[super init]){ Label *test=[Label labelWithString:@"Hello World" fontName:@"Helvetica" fontSize:24]; test.position=cpv(160,240); test.visible=YES; [self addChild:test]; } return self; }
ccp&的功能是什么? CPV?
(我认为这是为了设置图层的位置,但我不确定.所以我要求)
萨加尔