I'm using Wordookie with a lot of words, more than 20.000, my problem ist, that Processing stops rendering the snapshots/frames after various times. After 700 frames, after 1200 frames, after 900 frames. an so on.
I dont why, and hope someone can help? And sorry for my bad english :-)
final String INPUT_FILE = "book.txt"; final String FONT_NAME = "Times"; final color BACKGROUND = color( 0 ); final int MAX_FONTSIZE = 180; final int MIN_FONTSIZE = 30; final int FADE = 2; final boolean TAKE_SNAPSHOTS = true;
// redraw the whole thing except for word background( BACKGROUND ); for( Iterator witr = wordMap.values().iterator(); witr.hasNext(); ) { ColoredWord w = (ColoredWord)witr.next(); if ( w != word ) { fill( w.col, w.life ); layout.paintWord( w ); } }
if ( word == null ) { word = new ColoredWord( token, 1f ); word.font = font; word.col = ColorStuff.BlueIce[ (int)random(ColorStuff.BlueIce.length) ]; wordMap.put( token, word ); word.fontSize = (int)min( word.weight + MIN_FONTSIZE, MAX_FONTSIZE ); layout.doLayout( word ); } else { // fit word in word.weight += 1; word.fontSize = (int)min( word.weight + MIN_FONTSIZE, MAX_FONTSIZE ); if ( layout.intersects( word ) ) layout.doLayout( word ); }
word.life = 255; fill( word.col, word.life ); layout.paintWord( word );
// decrease life for( Iterator witr = wordMap.values().iterator(); witr.hasNext(); ) { ColoredWord w = (ColoredWord)witr.next(); w.life -= FADE; if ( w.life < 0 ) w.life = 0; }