Retina Text Different Y-coordinates

I’m using display.newRetinaText to display some text on screen. This text works fine on retina displays, but when shown on a non-retina display screen it is not positioned in the same place, it’s off on the Y-axis by about 15 pixels.

The obvious quick fix is to check if it’s a retina-capable device and then adjust the Y-coordinate. How can I do this?

I have found system.getInfo(‘architectureInfo’), but the documentation isn’t clear enough to tell what iPhone4, 4S and latest iPod Touches are. I’m sure someone must have this somewhere, I just can’t find it.

Any ideas? [import]uid: 61422 topic_id: 18192 reply_id: 318192[/import]

I’ve managed to fix this. It seems newRetinaText has a different reference point depending on whether it’s a retina screen or not.

Easy fix, manually set the reference point every time you change the text.

Not sure if this should be raised as a bug or not? [import]uid: 61422 topic_id: 18192 reply_id: 69557[/import]

This has already been reported as a bug. The retina text is positioned correctly until you try to modify the x or y position after it’s created. The solution for now is to the add a [lua]object:setReferencePoint( display.CenterReferencePoint )[/lua] after the retina text object is created.
[import]uid: 7559 topic_id: 18192 reply_id: 69576[/import]

I have this bug too and I reported this.

This workaround above is not working for me… [import]uid: 89239 topic_id: 18192 reply_id: 69579[/import]

you can use beebegames class. its works fine. no bugs with ReferencePoint.

http://jonbeebe.tumblr.com/post/2351470837/beebegames-class-newretinatext-tutorial [import]uid: 96683 topic_id: 18192 reply_id: 69580[/import]

@office83, you need to provide a simple example showing that it’s not working. The display.centerReferencePoint is working for the bug report that I received. I looked in the source code and found it setting the reference point to TopLeft when it should be Center. [import]uid: 7559 topic_id: 18192 reply_id: 69584[/import]

the fix is working. [import]uid: 90610 topic_id: 18192 reply_id: 69609[/import]

Ah cool. Now I know what is wrong with my app on Android. [import]uid: 10389 topic_id: 18192 reply_id: 69617[/import]

Although the newRetinaText looks blurry on my iPad 2… [import]uid: 10389 topic_id: 18192 reply_id: 69618[/import]

It does on everyones. newRetinaText makes crisp text for retina displays, which the iPad 2 is not. Frustrating I know. I think there is a library that will sort it for you though [import]uid: 62042 topic_id: 18192 reply_id: 69679[/import]

@ Tom

I don’t want my text to appear on center only. the score is on center but the time and lifes are on left and right. with your method it’s only working for the texts which are positioned in the center of the screen…
[import]uid: 89239 topic_id: 18192 reply_id: 69732[/import]

Regarding to the fix mentioned above; if you insert text display object to a group, you should set the reference point after insertion. [import]uid: 11686 topic_id: 18192 reply_id: 69733[/import]

@office83,

The bug fix I mentioned makes it compatible with display.newText, which internally sets the reference point to center. The display.newRetinaText calls display.newText on non-retina devices. If you want the text TopLeftReference instead of Center, and for it to work correctly on retina and non-retina devices, set the reference point to TopLeftReference after it’s created. [import]uid: 7559 topic_id: 18192 reply_id: 69734[/import]

@waulok,

The iPad is not a retina display so the call to display.newRetinaText calls display.newText internally. If the text is blurry, something else is going on that is not releated to newRetinaText. [import]uid: 7559 topic_id: 18192 reply_id: 69735[/import]

It was working but starting with new build of corona (not sure about the version)
there was a huge align problem about retina and non-retina devices. text x,y positions not showing same.

I try to put text into an another display group but bug continues…

[code]

local dialog = display.newRetinaText(“Lorem Ipsum”, 0, 0, 232, 80, font, 15)
dialog:setTextColor(0)
dialog:setReferencePoint ( display.TopLeftReference )
dialog.x = 0
dialog.y = 0
textObjGroup:insert( dialog )
textObjGroup:setReferencePoint ( display.TopLeftReference )
textObjGroup.x = 100
textObjGroup.y = 100
localGroup:insert( textObjGroup )
[/code] [import]uid: 96683 topic_id: 18192 reply_id: 80040[/import]

I solved like that. by setting referencepoint after inserting. but I confused too much about safe positioning…

local dialog = display.newRetinaText("Lorem Ipsum" , 0, 0, 232, 80, font, 15) dialog:setTextColor(0) --dialog:setReferencePoint ( display.TopLeftReference ) dialog.x = 100 dialog.y = 100 textObjGroup:insert( dialog ) textObjGroup.x = 206 textObjGroup.y = 60 localGroup:insert( textObjGroup ) textObjGroup:setReferencePoint ( display.TopLeftReference ) [import]uid: 96683 topic_id: 18192 reply_id: 80063[/import]

I think you need the word “Point” at the end of the reference points constants.

See: http://developer.anscamobile.com/reference/index/objectsetreferencepoint

display.CenterReferencePoint
display.TopLeftReferencePoint
display.TopCenterReferencePoint
display.TopRightReferencePoint
display.CenterRightReferencePoint
display.BottomRightReferencePoint
display.BottomCenterReferencePoint
display.BottomLeftReferencePoint
display.CenterLeftReferencePoint
[import]uid: 19626 topic_id: 18192 reply_id: 80095[/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: 18192 reply_id: 94926[/import]

This bug still continues. I have the built 2012.828 (2012.12.8) and on retina display texts are off on the y-axis by about -3 pixels.

Isn’t there a stable fix for this? [import]uid: 5629 topic_id: 18192 reply_id: 112127[/import]

Yeah I’m seeing this bug too, it seems to be more or less pronounced depending on which font you’re using and whether the app is running on iOS or android.

I’ve resorted to setting up a global offset variable ‘o’ in main.lua, which detects the environment/device and adjusts accordingly. I then add this everytime I set the ‘y’ value of retina text.

[import]uid: 93133 topic_id: 18192 reply_id: 112136[/import]