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);

上一篇:DataTable转换为List或者DataRow转换为T


下一篇:把DataTable转换为泛型List或是JSON