You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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.


Avatar for Gordon @Gordon started