I may be confused by the question, but are you simply asking how to right justify the text?
If that is the case. You would use a right reference point for the text object. The key here is you need to reset the reference point and the x/y position after each text update.
For example. Below if you set the reference point to the right edge of the device’s screen, whenever you update the text, update the ref point and x/y again and it will always be right justified and will extend out towards the left as the text grows longer.
myText = display.newText("",0,0,native.systemFont,14)
function updateText(newtext)
myText.text = newtext
myText:setReferencePoint(display.CenterRightReferencePoint)
myText.x = display.contentWidth
myText.y = display.contentHeight\*.5
end
The example would make the text act like so as you made it longer.
| |
| T|
| Te|
| Tex|
| Text|
Hope that makes sense.
EDIT: fixed the code example. [import]uid: 56820 topic_id: 24133 reply_id: 97403[/import]