Get width of text in pixels

I am wondering if there is a way to get the width of a text object?

For example if I do:

local someText = display.newText( ‘Hello World’, 0, 0, native.systemFont, 70 )

Can I get the width of this text in pixels?

Thanks,
Jon [import]uid: 65415 topic_id: 33225 reply_id: 333225[/import]

You just need to do:

local textWidth = someText.width

[import]uid: 70847 topic_id: 33225 reply_id: 132042[/import]

[lua]someText.width[/lua] will do it.

See here for more parameters: http://docs.coronalabs.com/api/type/DisplayObject/index.html [import]uid: 110228 topic_id: 33225 reply_id: 132044[/import]

Ah thanks, I had read .width but managed to mis-interpret it. Works perfectly. Thanks. [import]uid: 65415 topic_id: 33225 reply_id: 132045[/import]

You just need to do:

local textWidth = someText.width

[import]uid: 70847 topic_id: 33225 reply_id: 132042[/import]

[lua]someText.width[/lua] will do it.

See here for more parameters: http://docs.coronalabs.com/api/type/DisplayObject/index.html [import]uid: 110228 topic_id: 33225 reply_id: 132044[/import]

Ah thanks, I had read .width but managed to mis-interpret it. Works perfectly. Thanks. [import]uid: 65415 topic_id: 33225 reply_id: 132045[/import]