Is there a way to specify a text's x and y coords based on the bottom RIGHT corner? [SOLVED]

If I have a text with an ever increasing length against the right side of the devices screen and I do not want it to leave the screen, how would I do this?

For text based on the bottom right corner:

textMode(CORNER)

To keep text from going off the screen:

textWrapWidth(WIDTH)

Full usage example:

fontSize(48)
textMode(CORNER)
textWrapWidth(WIDTH - 200)
text(string.rep("test ", 50), 100, 100)

http://codea.io/reference/Graphics.html#textAlign

http://codea.io/reference/Graphics.html#textSize

etc, just look at Reference link at top of page

@Paintcannon Maybe something like this? Get width of string and subtract from its position

function setup()
    parameter.text("textString","test")
end
function draw()
    background(40, 40, 50)
    local x,y = textSize(textString)
    textMode(CORNER)
    text(textString,WIDTH-x,400)
end

@Jaybob Yes this is in a way exactly what I was looking for (a way to measure the text size), thank you.