722 .text doesn't update text for retina devices

Hi, just stumbled upon this bug. If you’ve got a text object:

local foo = display.newRetinaText("Hello", 200, 200)

and then want to change it’s text to:

foo.text = "Hello World"

On the 3GS it will display “Hello World”, on the 4/4S it will still display “Hello”… It’s only like this with the newRetinaText() api, the newText() works as it should

// [import]uid: 14018 topic_id: 20111 reply_id: 320111[/import]

Well I noticed a change with diaplay.newEmbossedText() too.

I’ve heard that there will be work on display.newRetinaText gate in daily builds soon. Perhaps there are changes coming and you wiil have to use something like :setText() to change the text like embossedText needs.

[import]uid: 19626 topic_id: 20111 reply_id: 78617[/import]

Thanks, :setText() works perfectly [import]uid: 14018 topic_id: 20111 reply_id: 78626[/import]

I just tried to use :setText() and it triggers a syntax error… I’m using build 726. Which build should have it included?

Also, does anyone know if there’s a way to adjust the line height so I can have my multi-line text have more space between lines? [import]uid: 9905 topic_id: 20111 reply_id: 80920[/import]

Retina text has been a problem with those text that needs to be updated. I tried setText() but it has not worked in all cases…

Any thoughts what is the best way to update a retina text. [import]uid: 84539 topic_id: 20111 reply_id: 80931[/import]

bejoy, check out this thread (specifically, jonathanbeebe’s comment near the bottom:
http://developer.anscamobile.com/forum/2011/12/14/huge-corona-simulator-text-positioning-bug-705706 [import]uid: 9905 topic_id: 20111 reply_id: 80938[/import]

Retina and embossed text no longer support the changing of text via setting the .text property (that property should be read-only for all retina text).

Instead, use the setText() method as others have pointed out (thanks for the responses everyone!)

Also, if using the widget library, be sure that you require it before any other module, especially if they use display.newText or display.newRetinaText. [import]uid: 52430 topic_id: 20111 reply_id: 80961[/import]

Jonathan, I’m using version 726 and I get an error with setText() but it works fine when I use .text:

local subheadText = display.newRetinaText("Testing", 40, 240,native.systemFont, 52)  
subheadText:setTextColor(218, 61, 41)  
subheadText:setText("1234") -- this results in a Runtime error: ...david/Documents/iPhone Dev/Corona/MSC2/test/main.lua:5: attempt to call method 'setText' (a nil value)  

But this works:

local subheadText = display.newRetinaText("Testing", 40, 240,native.systemFont, 52)  
subheadText:setTextColor(218, 61, 41)  
subheadText.text = "1234" -- this works fine  

It doesn’t seem to make any difference what device I view as in the Simulator. [import]uid: 9905 topic_id: 20111 reply_id: 81007[/import]

I think I got it working :slight_smile:

You should -always- require widget library before using retina text. If you did not require it, calling setText() function throws an exception (because it is not defined)

I am tested this with build 731 in corona simulator on pc.

[import]uid: 11686 topic_id: 20111 reply_id: 82223[/import]

Yes, but what are my options if I wish to remain on build 704- the latest stable release. There doesn’t appear to be any setText method for RetinaText with this build- widget library or not. Please clarify. Will changing .text in build 704 followed by updating the reference point and x y properties be enough to work on iPhone 4 or am I forced to use a daily build? If so, which is the least buggy best performing daily build that I should use? [import]uid: 106887 topic_id: 20111 reply_id: 88147[/import]

Anything after 704 will only work with .text
SetText has been removed.
Make sure you require the widgets library first thing! [import]uid: 10389 topic_id: 20111 reply_id: 88512[/import]

Regarding retina text:

display.newText() has been modified to handle “retina text” automatically, and therefore display.newRetinaText() has been deprecated since it is no longer needed.

The changes will be reflected in the next daily build (the one posted *after* 2012.770). [import]uid: 52430 topic_id: 20111 reply_id: 94914[/import]

Maybe i am wrong but i can’t find any reference to :setText property in the API docs. Only a comment by an Indie in the Retina api follows-up.

Does i need to look somewhere specifically?

Thanks

[import]uid: 107375 topic_id: 20111 reply_id: 101226[/import]

Grandezot, afaik it’s only available for subscribers yet? Unless Corona has been updated for non subscribers with it [import]uid: 14018 topic_id: 20111 reply_id: 101243[/import]

Read DavidBFox’s second paste. [import]uid: 10389 topic_id: 20111 reply_id: 101252[/import]