@cadaei Yeah, it works with Cocos2d. I think they added it in version 3 (though maybe I’m wrong about that?) I remember when v3 came out awhile ago I was looking in the CCLabelTTF header file and was pleasantly surprised to see the labelWithAttributedString: factory method there. I think it is pretty overlooked API (at least I overlooked it for awhile) and I can’t recall seeing a Cocos2d tutorial that talked about it. Since CCButton has a label you can also use attributed strings with buttons. You can definitely do some clever things with attributed strings in your game.
I just typed up some text in a Visual Attributed String document and made a new Cocos2d Xcode project. I grabbed the background color and text color from the Cocos2d logo and even dropped the image in my document. Here's the screenshot from VAS:
In my Cocos2d project, I just made a CCLabelColorNode for the background and added it to the scene (I got the RGB value from VAS)
CCNodeColor *backgroundColorNode = [CCNodeColor nodeWithColor:[CCColor colorWithRed:0.964 green:0.517 blue:0.166]];
Then I created a CCLabelTTF with the attributed string:
CCLabelTTF *label = [CCLabelTTF labelWithAttributedString:attributedString];
Here’s a screenshot from the iOS simulator. Even the Cocos2d logo image is part of the attributed string (the image is actually part of the label, it's not a separate sprite). Of course, you have to remember to add the image into your Xcode project as a resource to do that