There's no align built in, but it's easy enough to use stringWidth and then do what you want with it. I usually do something like:
g.drawString(text, x-(g.stringWidth(text)*(1-align)/2), y); // align -1 = right edge // 0 = center // 1 = left edge
Otherwise it looks like you can just replace your code under // draw text with it.
// draw text
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
There's no align built in, but it's easy enough to use stringWidth and then do what you want with it. I usually do something like:
Otherwise it looks like you can just replace your code under
// draw text
with it.