Search in sources :

Example 1 with PGraphicsJava2D

use of processing.awt.PGraphicsJava2D in project WordCram by danbernier.

the class ProcessingWordRenderer method drawWord.

public void drawWord(EngineWord word, Color color) {
    GeneralPath path2d = new GeneralPath(word.getShape());
    //        Graphics2D g2 = (Graphics2D)destination.image.getGraphics();
    Graphics2D g2 = ((PGraphicsJava2D) destination).g2;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setPaint(color);
    g2.fill(path2d);
}
Also used : GeneralPath(java.awt.geom.GeneralPath) PGraphicsJava2D(processing.awt.PGraphicsJava2D) Graphics2D(java.awt.Graphics2D)

Aggregations

Graphics2D (java.awt.Graphics2D)1 GeneralPath (java.awt.geom.GeneralPath)1 PGraphicsJava2D (processing.awt.PGraphicsJava2D)1