How draw text on CCSprite?

How draw text on CCSprite?
0.0 0



Just one question about drawing in CCSprite.
How it is possible to draw text over sprite image in draw function.
I overloaded a CCSprite and want to draw text over image in CCSprite draw member function.
How can i accomplish this ?



You can refer to the implement of CCLabelTTF, pass the string to CCImage::initWithString, convert the charactors to bitmap, then convert bitmap to CCTexture2D, at last bind this texture in draw function of CCSprite.


Thanks, it works.
And one more question.
How can i change the color of text in CCImage ?


CCSprite has a function setColor().


Let me explain situation.
I draw grid in sprite draw() function, grid has red lines.
In the center of each rectangle i place text and it should be yellow.