Get the content height of Native.newTextBox?

I’m working on a chat functionality in my game and would like to support emoji characters. As far as I know the only way to show these in Corona is to put the messages in a native textbox. I know they are shown in a display.newText object but the color of the emoticon will be the fillcolor of the object. 

Because I’m looking for a design kind of like iMessage (players messages are aligned right, opponents messages are aligned left) each message will be a separate textbox. Because some message will be more than one line I have to use the native.newTextBox object but I don’t want the textbox to scroll, the complete message has to be visible. Is there a way to get the content height of a native textbox so I can resize the textbox to prevent the scrollbar? Or some way to calculate the height of the text given a specific font and font size?

If anyone knows a different/better approach to make a chat, suggestions are welcome!

Thanks!

It seems you can just create a display.newText with the same style you want for the native textbox and get it’s height, which you can use for the creation of the native.newTextBox. Just add some margin for the scrollbars.

It seems you can just create a display.newText with the same style you want for the native textbox and get it’s height, which you can use for the creation of the native.newTextBox. Just add some margin for the scrollbars.

Hi @Saco.

Same problem here… Emoji on Corona display text is simply impossible to use due to its mono-color.

I went to use the textBox solution and got the issue (the vertical scrollbar). So, you are using the display.newText to calculate the height or got found another solution?  If yes, are you satisfied with that?

Hi @Saco.

Same problem here… Emoji on Corona display text is simply impossible to use due to its mono-color.

I went to use the textBox solution and got the issue (the vertical scrollbar). So, you are using the display.newText to calculate the height or got found another solution?  If yes, are you satisfied with that?