Forum > C# > Bug or problem: CCLabelBMFont with align (anchor) and new line

Bug or problem: CCLabelBMFont with align (anchor) and new line

By camelot Posted 2012-04-15 15:37 Comments 1
camelot
  • Posts: 37

text align incorrectly inside sprite if string is multiline.

label = CCLabelBMFont.labelWithString("some text \n with multiline", "font");
label.anchorPoint = new CCPoint(0.5f, 0.5f);
addChild(label);

with that example - label anchored correctly, but text inside aligned to left.

is that bug or i do something wrong?

huangrh
  • Posts: 171

#1 RE: 2012-04-25 02:25

Hi, you could try .

In fact i have tried , and it acts well.
I changed the code in Helloworld:
CCLabelTTF pLabel = CCLabelTTF.labelWithString(“Hello World”, “Arial”, 24);

Loggin to reply

Copyright © 2010 - 2013 Cocos2d-x.orgClustrmaps