newRetinaText doesn't work properly

Hi,

I can’t get newRetinaText behave the same way newText does.

Here we can see the difference:
http://dl.dropbox.com/u/1716912/temp/retina.jpg

The code:

 self.pointsText = display.newText("0 Points", 0, 0, fontName, fontSize)  
 self.timeText = display.newText(LEVEL\_PROPERTY.levelTime.." seconds left", 0, 0, fontName, fontSize)  
 self.levelText = display.newText("Level 1", 0, 0, fontName, fontSize)  
  
 self.pointsText:setReferencePoint(display.CenterLeftReferencePoint)  
 self.timeText:setReferencePoint(display.CenterLeftReferencePoint)  
 self.levelText:setReferencePoint(display.CenterLeftReferencePoint)  
  
 self.pointsText.x = self.leftTextOffset; self.pointsText.y = 20  
 self.timeText.x = self.leftTextOffset; self.timeText.y = 40  
 self.levelText.x = self.leftTextOffset; self.levelText.y = 60  

and in each frame:

[code] self.pointsText.text = self.points…" Points ("…LEVEL_PROPERTY.nextLevelAt…", “…self.multiplier…”)"
self.timeText.text = “Remaining time: “…(string.format(”%.0f”, self.timeRemaining))
self.levelText.text = "Level: "…self.level

self.timeText:setReferencePoint(display.CenterLeftReferencePoint)
self.pointsText:setReferencePoint(display.CenterLeftReferencePoint)
self.levelText:setReferencePoint(display.CenterLeftReferencePoint)

self.timeText.x = self.leftTextOffset;
self.pointsText.x = self.leftTextOffset;
self.levelText.x = self.leftTextOffset;

self.timeText:toFront()
self.pointsText:toFront()
self.levelText:toFront()[/code]

The only thing I changed was the initial creation with either newRetinaText (top image) or newText (lower image).

I can’t explain why newRetinaText gives so strange results. Note that the the position of the red line (which is drawn afterwards with paint) changes all the time as the text changes, which shouldn’t happen. [import]uid: 68079 topic_id: 23443 reply_id: 323443[/import]

Hey there - have you filed a bug report for this as well? :slight_smile: [import]uid: 52491 topic_id: 23443 reply_id: 94033[/import]

No. Not yet. I thought that it may be already reported as it should happen to many other people as well. :wink:

[import]uid: 68079 topic_id: 23443 reply_id: 94065[/import]

I now submitted an bug report (Case #12923).

I created a example project, where I observe the bug (2012.752)

main.lua:

[code]local points = 1

ret = display.newRetinaText("", 0, 0, system.defaultFont, 20)
ret.y = 40

nor = display.newText("", 0, 0, system.defaultFont, 20)
nor.y = 70

function onEnterFrame()
ret.text = points…" Retina moves to much"
ret:setReferencePoint(display.CenterLeftReferencePoint)
ret.x = 0;

nor.text = points…" Normal is Ok"
nor:setReferencePoint(display.CenterLeftReferencePoint)
nor.x = 0;

points = points+1
end

Runtime:addEventListener(“enterFrame”, onEnterFrame)
[/code]

config.lua:

application = { content = { width = 320, height = 480, scale = "zoomStretch", fps = 60 } }

Note that the retina version is off by 1 character. At least it seems that way. The config file is also important. [import]uid: 68079 topic_id: 23443 reply_id: 94068[/import]

Ah, a daily build - can you tell me if this issue also occurs in our latest stable build, 704, please? :slight_smile: [import]uid: 52491 topic_id: 23443 reply_id: 94210[/import]

Yep. 2011.704 Behaves the same. [import]uid: 68079 topic_id: 23443 reply_id: 94248[/import]

No longer relevant so deleted [import]uid: 10629 topic_id: 23443 reply_id: 94302[/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: 23443 reply_id: 94924[/import]