newText problem

Sorry, I have a problem with newText when I build my application and run on iOS ver.11.4.1 or above. The text use display.newText cut off from full text but if run on Android or Simulator text isn’t cut off.

I used Corona SDK ver.2018.3424

 local options = { text = params.guidetripArticle, x = myApp.width \* 0.05, y = date.y + date.height + 10 \* myApp.stdHeight, width = myApp.width \* 0.9, font = myApp.mainFont, fontSize = 14 } local detail = display.newText( options ) detail:setTextColor(91/255) detail.anchorX = 0 detail.anchorY = 0 scrollView:insert(detail)

This is my code and text sent by API 

I’m using 2018.3410 and I don’t have any issues with display.newText(). Unless something has happened, then I guess that your issue lies with faulty parameters, which I can’t test for.

It is possible that one or more of those parameters is nil or a much higher value than you expect. In this case, we are most likely talking about the value for width. For testing purposes, try replacing that (or all values) with just a number and see if it starts working. If it starts working, then the problem lies with your parameters. For debugging, it’s best to print out all their values to see which one isn’t working.

b6a4c7687452694833b4f08a7c66195b.jpg

This is my text on Database and red arrow show position cut off 

fe186fa04b52522c8f4d155f9e1bacdf.jpg

This is my screen on iPhone 6 and end of text is “The most”.

Ah, I completely misunderstood you. I thought you meant that the text just keeps going and going, not respecting the width value set in the options. The pictures definitely help. :smiley:

I’m not sure what the problem might be. The documentation reads:

“When rendering a multi-line box of text, be careful that the final display object does not exceed any target device’s maximum texture size limit. If you need to render text objects with a large number of lines, you should create multiple text objects and position them one after the next.”

Perhaps the extra text is being cut off due to device limitations, which would mean that you need to cut the text into multiple text objects. Maybe someone else will know definitely what the answer is.

It might be worth reading this tutorial: http://docs.coronalabs.com/tutorial/system/textBlocks/index.html

But you’re inserting it in a scrollView is it a case you just need to scroll the screen to see the rest of the text?

Rob

It’s work. Thank you very much   :slight_smile:

I’m using 2018.3410 and I don’t have any issues with display.newText(). Unless something has happened, then I guess that your issue lies with faulty parameters, which I can’t test for.

It is possible that one or more of those parameters is nil or a much higher value than you expect. In this case, we are most likely talking about the value for width. For testing purposes, try replacing that (or all values) with just a number and see if it starts working. If it starts working, then the problem lies with your parameters. For debugging, it’s best to print out all their values to see which one isn’t working.

b6a4c7687452694833b4f08a7c66195b.jpg

This is my text on Database and red arrow show position cut off 

fe186fa04b52522c8f4d155f9e1bacdf.jpg

This is my screen on iPhone 6 and end of text is “The most”.

Ah, I completely misunderstood you. I thought you meant that the text just keeps going and going, not respecting the width value set in the options. The pictures definitely help. :smiley:

I’m not sure what the problem might be. The documentation reads:

“When rendering a multi-line box of text, be careful that the final display object does not exceed any target device’s maximum texture size limit. If you need to render text objects with a large number of lines, you should create multiple text objects and position them one after the next.”

Perhaps the extra text is being cut off due to device limitations, which would mean that you need to cut the text into multiple text objects. Maybe someone else will know definitely what the answer is.

It might be worth reading this tutorial: http://docs.coronalabs.com/tutorial/system/textBlocks/index.html

But you’re inserting it in a scrollView is it a case you just need to scroll the screen to see the rest of the text?

Rob

It’s work. Thank you very much   :slight_smile: