0

How can I create an attributed label in Cocos2d?

Specifically I'm looking for a label where the color of each word can be unique. I read about ZAttributed string however the Github page no longer exists. Also searching the Cocos2d v2.1-beta2 codebase doesn't turn up anything for attributed string on iOS.

If nothing exists I'll probably just create my own object. I think everything would be straight forward except possibly the spacing between groups of words across a color change boundry.

Community
  • 1
  • 1
SundayMonday
  • 19,147
  • 29
  • 100
  • 154

1 Answers1

2

CCLabelBMFont label is a series of textures that can be manipulated like any normal sprite. You can run actions on them, transform them and change their color.

Letters are tagged by their position

CCSprite *gletter = (CCSprite*)[label getChildByTag:0];
Tone
  • 322
  • 1
  • 3
  • 16