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(ccp(size.width/2, size.height/2)); 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
!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(ccp(size.width/2, size.height/2)); 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


test0.jpg (26.2 KB)


test0.jpg (26.2 KB)


test.jpg (39.2 KB)

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.

James Chen wrote:

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, can you paste your right codes:)