iphone - Adding text into a Sprite -


How can I add text or characters to Sprite? If this is not possible, then what is the option to get the same effect?

Note: I am using the COCOS2D Framework.

Edit:

I have tried this way -

  CCLabel * label = [[CCLabel alloc ] InitWithString: @ "H!" Dimension: CGSizeMake ([spriteObj contentSize]. Wide, [spriteObj contentSize]. Highlight) Alignment: UITextAlignmentCenter fontName: @ "Wordana" font size: 15.0f]; //label.position = newBubble.position; // ccp ([spriteObj contentSize] .wide / 2, [spriteObj contentSize] .height / 2); [Spritebose Adbild: Label Z: 10];  

This lesson 'H!' Shows in the lower left corner of the phantom.

As always points out, the phantom trick is adding a label as a child. The advantage of setting up sprat and labels in the same place is that, as a child, the label will participate in any animation that you can apply for the phantom. For example, CCScaleTo animation will scale labels with the image of the phantom.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -