How do you find the height and width of a CCLabelTTF object?


#1

I see in the api to create a CCLabelTTF object that you can either specify a height and width, or let the object auto-size… but I cannot find anything in the api that will tell you what the actual size of the label is if you let auto-size happen.

How can I determine the actual size of a CCLabelTTF if I’ve allowed Cocos to auto-size it for me?


#2

CCLabelTTF *label = CCLabelTTF::labelWithString("Hello", "Arial", 14); CCSize labelSize = label->getContentSize();

try this.