Evgeniy Rojkov Bug or problem: CCLabelBMFont with align (anchor) and new line
Posts 37
Added by Evgeniy Rojkov about 1 year ago

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?

RongHong Huang RE: Bug or problem: CCLabelBMFont with align (anchor) and new line
Posts 171
Added by RongHong Huang about 1 year ago

Hi, you could try \n\r.

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


(1-1/1)