How to set width to button titletext?

I have a button with long title text and width is small, so i want to load text in multiple line within a button,but the text goes out of button width and is displayed in a single line. so how to set the width to titletext in a button…

my button code is:

button5 = Button::create();
button5->setTitleText("click this big button with lots of text..");
button5->setTitleFontName("fonts/arial.ttf");
button5->setTitleFontSize(40);
button5->setTouchEnabled(true);
button5->loadTextures("blank.png", "blankd.png");
button5->setPosition(Point(visibleSize.width * 0.75 + origin.x, visibleSize.height * 0.25 + origin.y));
this->addChild(button5);

remove the title text from the button, instead create a label with it’s text which supports multiple lines and add it as a child to the button.

1 Like

Great, will use label then… thanks… but i thought there must be some way to set width to titletext.

i think this property should be available or you can add in next update…just my opinion… @slackmoehrle