[Resolved] newText() align left bug? (With code)

Hello,

Can someone let me know if there is something wrong with my code below? I am simply trying to align the text to the top left corner after the text is updated but it will not align left no matter what I try. I would rather not use any 3rd party tools. Although this might seem trivial I have spent around 3 hours attempting every possible method. The code below has been simplified to recreate the problem.

Thank you in advance.

-B

[code]

display.setStatusBar( display.HiddenStatusBar )

counter = 0

local txt = display.newRetinaText(counter , 0, 0, “HelveticaNeue”, 20);
txt.xScale, txt.yScale = 0.5, 0.5;
txt:setTextColor(255,255,255);
txt:setReferencePoint( display.TopLeftReferencePoint )
txt.x = 0
txt.y = 0

local function updateText()

txt.text = txt.text … counter
txt:setReferencePoint( display.TopLeftReferencePoint )
txt.x = 0
txt.y = 0

end

local clockTimer = timer.performWithDelay( 1000, updateText, -1 )
[/code] [import]uid: 64343 topic_id: 26079 reply_id: 326079[/import]

Changing to display.newText() does not work either…

local txt = display.newText(counter , 0, 0, "HelveticaNeue", 20);  

-B [import]uid: 64343 topic_id: 26079 reply_id: 105620[/import]

Try changing line 5 to this;
[lua]local txt = display.newRetinaText(counter , 0, 0, 320,100, “HelveticaNeue”, 20)[/lua]

Let me know how that goes for you, please :slight_smile:

Peach [import]uid: 52491 topic_id: 26079 reply_id: 105621[/import]

I solved the problem by removing the scaling… I found another post on the forums that offered that to another user that worked for me as well.

Thanks!

--txt.xScale, txt.yScale = 0.5, 0.5; [import]uid: 64343 topic_id: 26079 reply_id: 105623[/import]