Height of Wrapping CCLabelTTF with CCSize(val,0)

Using cocos2dx 2.2.2

I have a CCLabelTTF that wraps its string so I set it’s CCSize to be (somevalue,0) and it works perfectly. But I want to find the height of the CCLabelTTF which returns 0 when I do it. I tried using boundingBox().size but this returns 0 as well.

(CCLabel without dimension also returns 0 height)

How can I get height of wrapped CCLabelTTF?
or how many lines wrapped string is?

ex)
A Long string is wrapped in this CCLabelTTF

Let’s say above has height 10

A Long string
is wrapped in
this CCLabelTTF

this should return 30.

things I’ve tried:
getDimensions().height
getContentSize().height
boundingBox().height

all above returns 0…

reminding you again normal CCLabelTTF return 0 height as well.

So how can I get the resulted height of CCLabel?

could you explicitly set a height based upon the font size you are using? adjust as needed?

label->setContentSize(cocos2d::Size::Size(width, height));

Hi, which OS are you using?

Under iOS I use
float height = node->getContentSize().height * node->getScaleY();
where node is the CCLabelTTF I want to measure. The CCLabelTTF had it’s height set of 0.0f when created. I use the returned height to position the next line of text and it seems to be working fine.

@slackmoehrle If I were to set height based upon the font size I’m using, would the height be size of the font? or little bit bigger?

If I explicitly set the size, I would be able to get the height, but I want to get height withought setting the height by myself. Do you know any solution?

Never mind people. It works just fine.
My problem was that I tried to get height as integer while size.height or width returns float. Anyways, thanks for your participation and idea