-
Notifications
You must be signed in to change notification settings - Fork 52
Can't find the answer you need? Send me a note at wordcram-at-gmail, or ask @wordcram on twitter.
Yes. Save a reference to the wordcram, and in your sketch's
mouseClicked
events, ask the wordcram whether there's a word at the
mouse-click's coordinates. Something like this:
WordCram wordCram;
void setup() {
wordCram = new WordCram(this)...
wordCram.drawAll();
}
void mouseClicked() {
Word word = wordCram.getWordAt(mouseX, mouseY);
if (word != null) {
...
}
}
For a complete running sketch like this, check out Sketchbook > libraries > WordCram > tutorials > L_clickableWords.
Yes! It was added in the 0.5 release.
No, but I'm looking into it. It depends on whether javascript can "sense" the shape of the words to detect collisions. But it would be really cool to see word clouds in the browser.
If you're loading your fonts with
loadFont, try using
createFont
instead. loadFont
doesn't work as well for rendering characters at
different sizes.
Are you using something like Colorers.pickFrom(0)
or
Colorers.pickFrom(255)
? Try using Colorers.pickFrom(color(0))
and
Colorers.pickFrom(color(255))
instead.
Processing internally stores colors as
integers, with
the alpha in the highest bits, so it sees the integer 0 as colorless
and completely transparent. A WordCram created with
Colorers.pickFrom(0)
will render the words, they'll just be
invisible.
Colorers.pickFrom()
takes a bunch of colors, so it treats each
integer it gets as a Processing color/integer. This is really a
misleading API, and it should be sorted out.