public static void DrawString(Surface g, TextLayout layout, int x, int y) { CanvasImage c = Global.m_graphics.createImage( (int) Math.ceil(layout.width()), (int) Math.ceil(layout.height())); Canvas gc = c.canvas(); gc.drawText(layout, 0, 0); g.drawImage(c, x, y); }
protected float addDescrip(String descrip, float x, float y, float width) { ImageLayer layer = createDescripLayer(descrip, width); game.rootLayer.addAt(layer, Math.round(x + (width - layer.width()) / 2), y); return y + layer.height(); }