close
How can I add text or characters into a Sprite
from http://stackoverflow.com/questions/3402825/adding-text-into-a-sprite
How can I add text or characters into a Sprite. If it's not possible, is there any alternative to get the same effect?
NOTE: I am using COCOS2D framework.
EDIT:
I have tried in this way-
CCLabel* label =[[CCLabel alloc] initWithString:@"H!" dimensions:CGSizeMake([spriteObj contentSize].width,[spriteObj contentSize].height) alignment:UITextAlignmentCenter fontName:@"verdana" fontSize:15.0f];
//label.position = newBubble.position;//ccp([spriteObj contentSize].width/2, [spriteObj contentSize].height/2);
[spriteObj addChild:label z:10];
It shows the text 'H!' at the bottom left corner of the sprite.
全站熱搜