setFontAlign is new, but basically it defines how subsequent calls to drawString(txt,x,y) will align the text to x,y. In your example you've left x&y out, so it'll be using 0,0 as the centre, hence the apparent -2,-2.
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.
I just tried an original Espruino board and the code I posted above does work for me. Is there something else that isn't working for you?
Have a look at http://www.espruino.com/Reference#l_Graphics_setFontAlign
setFontAlign is new, but basically it defines how subsequent calls to
drawString(txt,x,y)
will align the text tox,y
. In your example you've left x&y out, so it'll be using 0,0 as the centre, hence the apparent-2,-2
.You probably wanted: