views:

28

answers:

0

How do you add a new line character to a string when using a custom font in cocos2d?

I have my atlas font and i tell i put the new line character into it and then tell it what font to use.

CCBitmapFontAtlas *text = [CCBitmapFontAtlas bitmapFontAtlasWithString:@"Something\nSomething else " fntFile:@"generic_font.fnt"];

In the .fnt file i added this line to it for the new line character:

char id=10 x=0  y=0  width=0  height=0  xoffset=0  yoffset=1  xadvance=0  page=0  chnl=0

When the text is drawn on the screen it just removes the \n from the string and draws everything on the one line. Any idea how i can fix this?