首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

cocos2d,CCRenderTexture的小疑点

2012-06-03 
cocos2d,CCRenderTexture的小问题-(CCSprite *)spriteWithColor:(ccColor4F)bgColor textureSize:(float)t

cocos2d,CCRenderTexture的小问题
-(CCSprite *)spriteWithColor:(ccColor4F)bgColor textureSize:(float)textureSize {

// 1: Create new CCRenderTexture
CCRenderTexture *rt = [CCRenderTexture renderTextureWithWidth:textureSize height:textureSize];

// 2: Call CCRenderTexture:begin
[rt beginWithClear:bgColor.r g:bgColor.g b:bgColor.b a:bgColor.a];

// 3: Draw into the texture
// We'll add this later

// 4: Call CCRenderTexture:end
[rt end];

// 5: Create a new Sprite from the texture
return [CCSprite spriteWithTexture:rt.sprite.texture];

}
最后那个rt.sprite.texture如果用C++写,应该怎么改,谢谢大神啊

[解决办法]
CCSprite::spriteWithTexture(rt->getSprite()->getTexture());

热点排行