
V3 RC4 版本图片

将Chapter1中 SpaceCargoShip.png 文件 添加到项目里面。
代码在 init :
CCSprite *spaceCargoShip = [CCSprite spriteWithImageNamed:@"SpaceCargoShip.png"];[spaceCargoShip setPosition:ccp(200.0f,150.9f)];[self addChild:spaceCargoShip];

在上面的代码下增加如下2行,就会出现动画效果。
id moveAction = [CCActionMoveTo actionWithDuration:5.0f position:ccp(0,100.0f)];[spaceCargoShip runAction:moveAction];
CGSize size =[[CCDirector sharedDirector] viewSize];NSLog(@"%f , %f",size.width,size.height);
cocos2d 游戏开发:Cocos2d v3 "hello world"+显示飞船,布布扣,bubuko.com
cocos2d 游戏开发:Cocos2d v3 "hello world"+显示飞船
原文地址:http://blog.csdn.net/woshiwupo/article/details/26819673