How to create a long line text using labels without breaking up words in the middle

CCLabelTTF* label = CCLabelTTF::labelWithString(“What is the label looks like depend on the content size of the label,and the content size is depend on the parameter const char *label and CGSize”,
CCSizeMake(200, 0),
CCTextAlignmentLeft,
“Arial”,
20);
label~~>setPosition);
this~~>addChild(label);

I used the method before, but “Whatisthelabellookslikedependonthecontentsizeof the label,and the content size”, many words an not be displayed on the screen


RE: How to create a long line text using labels without breaking up words in the middle - 由 James Chen 在 4 天 之前添加
I think you test the code on win32, it does exist on win32, but it works fine on android. The implement of ‘CCImage::initWithString’ on win32 should be modified.
———————————————————————————————
I am a new beginner, who can paste the right codes on win32 :slight_smile:


test0.jpg (26.2 KB)


test.jpg (39.2 KB)

Because you set the height of label(200, 0), labels exceed the height will be cut off.