RenderTexture is used to create placeholder sprites that can be used to prototype a game. So, if you want to test your movement and jump code on a sprite but don't have access to a sprite, this is a quick and dirty way to create a sprite.
To create the
RenderTexture sprite, we will create a new function, and this function will return a sprite when we provide the size and color of the sprite to be produced.
MainScene.h file, we will add the following highlighted line right under the
scene function we created earlier:
+(CCScene*)scene; -(CCSprite *)spriteWithColor:(ccColor4F)bgColor textureWidth:(float)textureWidth textureHeight:(float)textureHeight; @end
This function will return ...