开发者

How to use attributed Strings with cocos2d?

开发者 https://www.devze.com 2023-02-01 04:31 出处:网络
how to use CCLabelTTF with ZAttributedString? Lets say开发者_如何转开发 I want a blue Text \"Greetings to the World!\" but I want the word \"to\" in red.ZAttributedString is part of FontLabel, an ext

how to use CCLabelTTF with ZAttributedString? Lets say开发者_如何转开发 I want a blue Text "Greetings to the World!" but I want the word "to" in red.


ZAttributedString is part of FontLabel, an external library from Zynga that is packaged with Cocos2D. FontLabel uses ZFont, not CCLabelTTF, etc ...

Refer to here: https://github.com/zynga/FontLabel

It would appear they provide some very small examples, and you can peek into their UnitTests as well to see additional use cases.

0

精彩评论

暂无评论...
验证码 换一张
取 消