@rob_type25 wrote:
Hi there
Using Cocos2dx-3.10
Hopefully a trivial one but can't work it out...
How do i constrain a labels text to it's contentSize?
Example:
auto usernameLabel = Label::createWithTTF(item->username, "fonts/WhitneyMedium.ttf", 8.0); usernameLabel->setPosition(Vec2(0, cell->getContentSize().height/2)); usernameLabel->setContentSize(Size(20, usernameLabel->getContentSize().height)); usernameLabel->setOverflow(cocos2d::Label::Overflow::CLAMP);
This doesn't "clamp" the text. Ideally i'd like ellipsis but i'll settle for it just clipping the text at the moment.
Thanks!
Posts: 1
Participants: 1