import wordcram.*;import java.awt.*;
import java.util.ArrayList;import java.util.List;
void setup() {
PImage image = loadImage("../templates/HEART.png");
size(image.width, image.height);background(#ffffff);
Shape imageShape = new ImageShaper().shape(image, #000000);ShapeBasedPlacer placer = new ShapeBasedPlacer(imageShape);
new WordCram(this).fromWords(new Word[] { (WORDS GO HERE!)).withPlacer(placer).withNudger(placer).sizedByWeight(1, 200).angledAt(radians(0),radians(90),radians(-90)).
minShapeSize(0).drawAll();save("../OUTPUT.png");exit();}import java.io.FileNotFoundException;import java.util.*;
import processing.core.PApplet;import processing.pdf.*;import wordcram.*;import wordcram.text.*;import java.awt.*;
void setup() { size(600, 600); background(255);
initWordCram();}
void initWordCram() { PImage image = loadImage("yin-yang.png"); image.resize(width, height); Shape imageShape = new ImageShaper().shape(image, #000000); ShapeBasedPlacer placer = new ShapeBasedPlacer(imageShape);
new WordCram(this). fromWords(repeatWord("flexible", 500)). withPlacer(placer). withNudger(placer). sizedByWeight(4, 40). angledAt(0). withColor(#F5B502). drawAll(); imageShape = new ImageShaper().shape(image, #ffffff); placer = new ShapeBasedPlacer(imageShape); new WordCram(this). fromWords(repeatWord("usable", 500)). withPlacer(placer). withNudger(placer). sizedByWeight(4, 40). angledAt(0). withColor(#782CAF). drawAll(); save("OUTPUT.png");}
Word[] repeatWord(String word, int times) { Word[] words = new Word[times]; for (int i = 0; i < words.length; i++) { // Give the words a random weight, so they're sized differently. words[i] = new Word(word, random(1)); } return words;}Using save("output.png") should still work just fine…what are you seeing?
--
You received this message because you are subscribed to the Google Groups "WordCram" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wordcram+unsubscribe@googlegroups.com.
To post to this group, send email to word...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to wordcram+u...@googlegroups.com.
To post to this group, send email to word...@googlegroups.com.
Ah, my apologies, I have saved the sketch and now it seems to work.
--
You received this message because you are subscribed to the Google Groups "WordCram" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wordcram+unsubscribe@googlegroups.com.