我正在学习新版本的 cocos2d-x 2.1.4 导入 cocos2d 到 x 版本,我想移植这个部分:
spriteSheet = [CCSpriteBatchNode
batchNodeWithFile:"foo.gif"];
player = [CCSprite spriteWithBatchNode:spriteSheet
rect:CGRectMake(0, 0, 30, 56)];
至 :
spritSheet = CCSpriteBatchNode::create("foo.gif");
player = CCSprite::??? which function here ???();
在这里阅读:http: //www.cocos2d-x.org/projects/cocos2dx/wiki/API_Change_List_from_v1x_to_2x?version=2
CCSprite::spriteWithBatchNode(...) 被移除,请使用: sprite = CCSprite::spriteWithTexture(batchNode->getTexture(), CCRect*); batchNode->addChild(sprite); 反而
但是 CCSprite 中没有 spriteWithTexture 是什么替换?