A string being displayed as a box

Hi

I have a string which is 436 characters long. When displaying it on the corona simulator it is fine, but on the device (iPhone 5) it displays as a box the same colour as the text should be. This is is the same in the xcode simulator.

[lua]
local twitterText = display.newText(twitterStream,0,0,0,0,native.systemFont,13);
[/lua]

that’s my code - any suggestions?

Cheers [import]uid: 24641 topic_id: 35670 reply_id: 335670[/import]

Not sure exactly what you’re aiming to do, but by specifying width and height those values are set automatically by Corona (presumably to fit within the screen). Omit the last two 0’s and it should turn into a single line.

But you say it’s turning into a box, so what happens if you specify manual width (ie: display.contentWidth instead of 0?)

(Er…why 436? The twitter cap is much lower…) [import]uid: 41884 topic_id: 35670 reply_id: 141860[/import]

Sorry should have been more clear - I want one line of text - here’s the code immediately after the object is defined

[lua]

twitterText.x=display.contentWidth + twitterText.width
twitterText:setTextColor(4,76,139);
twitterText.y=twitterBox.y

[/lua]

I’ve removed the last two 0’s but it has had no effect - here is a photo of what happens:

http://cl.ly/image/1n3J1J1r230W

(the blue rectangle should be blue text. [import]uid: 24641 topic_id: 35670 reply_id: 141895[/import]

display.newText() renders text into an OpenGL Canvas texture. It’s possible that your text could be so large, it’s exceeding the texture size of the device and when that happens you get a block and not text.

If you take 436 bytes * 13 pixels (font size – before any one says that’s the height not the width, it’s an approximation…) is over 5,000 pixels wide, which is probably over the texture limit size.

[import]uid: 199310 topic_id: 35670 reply_id: 141920[/import]

Not sure exactly what you’re aiming to do, but by specifying width and height those values are set automatically by Corona (presumably to fit within the screen). Omit the last two 0’s and it should turn into a single line.

But you say it’s turning into a box, so what happens if you specify manual width (ie: display.contentWidth instead of 0?)

(Er…why 436? The twitter cap is much lower…) [import]uid: 41884 topic_id: 35670 reply_id: 141860[/import]

Sorry should have been more clear - I want one line of text - here’s the code immediately after the object is defined

[lua]

twitterText.x=display.contentWidth + twitterText.width
twitterText:setTextColor(4,76,139);
twitterText.y=twitterBox.y

[/lua]

I’ve removed the last two 0’s but it has had no effect - here is a photo of what happens:

http://cl.ly/image/1n3J1J1r230W

(the blue rectangle should be blue text. [import]uid: 24641 topic_id: 35670 reply_id: 141895[/import]

display.newText() renders text into an OpenGL Canvas texture. It’s possible that your text could be so large, it’s exceeding the texture size of the device and when that happens you get a block and not text.

If you take 436 bytes * 13 pixels (font size – before any one says that’s the height not the width, it’s an approximation…) is over 5,000 pixels wide, which is probably over the texture limit size.

[import]uid: 199310 topic_id: 35670 reply_id: 141920[/import]