CCLabelBMFont auto wrapping seem not work on v3.0 alpha0

I’ve heard that it supported word wrapping with CCLabelBMFont, i set the width, but I can’t seem to get it to work.

CCLabelBMFont::create(<#const char *str#>, <#const char *fntFile#>, <#float width#>, <#CCTextAlignment alignment#>, <#cocos2d::CCPoint imageOffset#>);

http://www.cocos2d-x.org/forums/6/topics/32521?r=32606#message-32606

it said: On 2.1.4 it wraps properly.
but i download v3.0 alpha0.

a bug?

ok, i found the problem

  1. _lineBreakWithoutSpaces is not set when call setstring

  2. why reset startOfLine and then call j—? it will make endless loop

                     if (i >= stringLength)
                         break;
    
                     //if (!startOfWord)
                     //{
                     //    startOfWord = getLetterPosXLeft( characterSprite );
                     //    start_word = true;
                     //}
                     //if (!startOfLine)
                     //{
                     //    startOfLine  = startOfWord;
                     //    start_line = true;
                     //}
    
                     j--;