import ctext.*; CText ctext; CGrammar grammar; void setup() { size(600, 400); ctext = new CText(this, "click!"); ctext.setFont("Arial-Black-16.vlw"); grammar = new CGrammar(this, "bgrammar.g"); } void draw() { background(255); ctext.draw(); } void mouseClicked() { // call the grammar String s = grammar.expand(); // create a new ctext ctext.setText(s); ctext.setAlpha(255); ctext.setLocation(width/2, height/3); // reset the 'fall' behavior ctext.removeBehaviors(); ctext.moveTo(width/2, height+20, 3); ctext.fadeOut(3); }