text Width/Height Troubles

Hi, hope somebody can help.

I'm trying to set the width/height properties on hint messages displayed during a load screen to enable multiple lines if needed - as some of the messages are quite long.

Unfortunately whenever I set the width/height properties on a newText object it seems to ignore the custom font and font size property. I'm also having a nightmare centering the text, but that's another issue:

I currently have this:

1
2
3
4
        local hint = display.newText(hintMessages[ran].label, 0, 280,460,0, "GangofThree",18)
        localGroup:insert(hint)
        hint:setReferencePoint(display.TopCenterReferencePoint)
        hint.x = _H/2

For centering text I use the following which seems to work on V644

1
2
hint:setReferencePoint(display.TopLeftReferencePoint)
hint.x = display.contentWidth *0.5 - (hint.width * 0.25)

Hi leginus - thanks that works like a charm. Now I've just got to try and see why setting height/width attributes is stopping the custom font from showing...

Thanks again...

views:1475 update:2011/12/28 9:26:54
corona forums © 2003-2011