I have a CCSprite subclass. In the draw method, I am drawing some cocos2d primitives like lines and such. How can I create a CCTexture2D of the sprite? I can’t use sprite.texture because that doesn’t include the primitives I am drawing.
I have a CCSprite subclass. In the draw method, I am drawing some cocos2d
Share
You can add sprite to object of CCRenderTexture2D and after this can draw sprite to texture.
look at the example
Now you will have texture, that contains sprite and primitives, that it draws in draw method.
Hope, it will help you:)