display.newText

hello, 

I have confused with newText

i use this code

local t = display.newText( descr, 10, 140 , display.contentWidth-20 ,0 , “helvetica”, 22)

            t:setTextColor( 0,0,0 )

            scrollView:insert(t) 

descr = is a dynamic text that came from a json

My problem is when the text is very large its not visible.

I dont understand what i have to change in order to run on all devices

thanks in advace

Hi @maverick.st,

A good tutorial to begin with is this:

http://www.coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Best regards,

Brent

I believe i am having a similar issue. if i read the question correctly, it is not the font that is not viewable but rather the volume of text presented that is not being seen.

If this is indeed the case i would also be interested to know a solution. 

when i use the disply:newText() and insert it into a scrollview, no matter what i set the wrap variables or the scrollview variables, the view does not scroll to match the inserted text.

Hi @jeremy.wayne,

Can you show some basic code? When you say that it doesn’t scroll to match the text, do you mean the text flows much further than the limits of the scroll view, and you can’t scroll down to see it all?

Brent

There is a notice in the documentation that with set width and height = 0 the text will only stretch to the maximum device texture size.

If you are going to have a big block of text, you might be best trying a native.newWebView().  That will get your text into native space and out of the OpenGL canvas where there is a texture limit size.  On some older devices this could work out to as little as 1024px of height, with most devices at 2048px. 

Now native.newWebView()'s are native objects and can’t be inserted into groups, have other things drawn on top, etc.  The other thing to do is to parse the text and break it into manageable like paragraphs and just have multiple text objects.

Rob

Hi @maverick.st,

A good tutorial to begin with is this:

http://www.coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Best regards,

Brent

I believe i am having a similar issue. if i read the question correctly, it is not the font that is not viewable but rather the volume of text presented that is not being seen.

If this is indeed the case i would also be interested to know a solution. 

when i use the disply:newText() and insert it into a scrollview, no matter what i set the wrap variables or the scrollview variables, the view does not scroll to match the inserted text.

Hi @jeremy.wayne,

Can you show some basic code? When you say that it doesn’t scroll to match the text, do you mean the text flows much further than the limits of the scroll view, and you can’t scroll down to see it all?

Brent

There is a notice in the documentation that with set width and height = 0 the text will only stretch to the maximum device texture size.

If you are going to have a big block of text, you might be best trying a native.newWebView().  That will get your text into native space and out of the OpenGL canvas where there is a texture limit size.  On some older devices this could work out to as little as 1024px of height, with most devices at 2048px. 

Now native.newWebView()'s are native objects and can’t be inserted into groups, have other things drawn on top, etc.  The other thing to do is to parse the text and break it into manageable like paragraphs and just have multiple text objects.

Rob