ccrendertexture

int bgHeight=150;
CCSprite *sp=CCSprite::create("HelloWorld.png");
sp->setAnchorPoint(ccp(0,1));
sp->setPosition(ccp(0,bgHeight));   

CCRenderTexture *render=CCRenderTexture::create(visibleSize.width,bgHeight);
render->begin();
sp->visit();
render->end();
render->setPosition(ccp(visibleSize.width/2,visibleSize.height/2));
addChild(render);
//or
CCSprite* label=CCSprite::create();
CCTexture2D *texture=new CCTexture2D();
texture->initWithImage(render->newCCImage());
label->initWithTexture(texture);
label->setAnchorPoint(ccp(0,0));
addChild(label);

你可能感兴趣的:(text)