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
© Espruino, powered by microcosm.
Report a problem