/** * blits given string to frame buffer. works very similar to awt.Graphics#drawString(..) that is: * x coordinate is left most point in string, y is baseline * * @param buffer buffer to blit into * @param s string to blit * @param x leftmost point * @param transparency transparency value, make sure >= 0 * @param color text color * @param y baseline */ public void blitString( FrameBuffer buffer, String s, int x, int y, int transparency, RGBColor color) { y -= baseline; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); int index = alphabet.indexOf(c); if (index == -1) index = alphabet.indexOf('?'); if (index != -1) { Point size = pack.blit(buffer, index, x, y, transparency, false, color); x += size.x; } } }