display.newText Jumping

I’m creating the following in my storyboard createscene method

[lua] – Create the text for the distance score running in the top left corner
local distanceString = string.format("%s: %i", “Distance”, myGlobal.distance)
local myDistance = display.newText(distanceString, 0.05 * _W + _originX, -100, “myfont”, fontSize)[/lua]

and then in my game loop I am updating it via the text property

[lua]myGlobal.distance = myGlobal.distance + 1
local distanceString = string.format("%s: %i", “Distance”, myGlobal.distance)
myDistance.text = distanceString [/lua]

With the reference point being a default of top left what I don’t understand is why the text is jumping around. If I remove and recreate the text each time and position at the same point it doesn’t jump.

Nothing seems documented about the text method update but clearly I am missing something obvious.

Can you advise please

J [import]uid: 103970 topic_id: 24524 reply_id: 324524[/import]

After you change the text, set the ReferencePoint again, and the x and y coordinates for the text.

That’s how i solved it, maybe it’s a bug, but for me that was the only way to make it work…

[import]uid: 50459 topic_id: 24524 reply_id: 99362[/import]

@rmbsoft Awesome that has sorted it!!

Raising this as a bug as there is no interference that setText required three other properties to be updated. Either framework or documentation needs to be improved

J [import]uid: 103970 topic_id: 24524 reply_id: 99373[/import]