import rita.*; /* * @desc Drawing RiTexts to offscreen buffers */ PGraphics b; PImage img; RiText rt; void setup() { size(300, 300); RiText.disableAutoDraw(); RiText.createDefaultFont("Arial", 36); b = createGraphics(200, 200, JAVA2D); rt = new RiText(this, "Buffer", 0, 100); rt.moveTo(b.width, 100, 3f); } void draw() { b.beginDraw(); b.background(255); rt.draw(b); b.endDraw(); // draw the offscreen buffer image(b.get(0, 0, b.width, b.height), 0, 0); // restart animation if (rt.isOffscreen(b)) { rt.setLocation(0, 100); rt.moveTo(b.width, 100, 3f); } }