示例#1
0
 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);
 }
示例#2
0
 /** Prepares the canvas and renders the supplied layout at 0, 0 using the given config. */
 public void renderText(TextConfig config, TextLayout layout) {
   prepare(config.effect.adjustWidth(layout.width()), config.effect.adjustHeight(layout.height()));
   config.render(canvas(), layout, 0, 0);
 }