- (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];
}
If that last rt.sprite.texture written in C + +, it should be how to change, big thank you God
Reply:
CCSprite :: spriteWithTexture (rt-> getSprite () -> getTexture ());
No comments:
Post a Comment