林學習了cocos2d-x 2.1.4 IM cocos2d的移植到X版本的新版本,我想將本節:cocos2d-x 2.1.4版本2.1.4中的spriteWithTexture在哪裏?
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(b atchNode-> getTexture(),CCRect *); batchNode-> addChild(sprite);而不是
但在CCSprite中沒有spriteWithTexture 什麼是替換?