Hi again,
I am trying to get a Rita library example working and am getting this error message:
Exception in thread "Animation Thread" java.lang.IllegalStateException: [ERROR] Undefined grammar token: '<start>' in haiku.g.rtf
I have downloaded the Rita library from here:
http://www.rednoise.org/rita/
I have also created an RTF file in my data folder called:
"haiku.g.rtf"
It seems to be correct in terms of the library documentation (here):
http://www.rednoise.org/rita/documentation/rigrammar_class_rigrammar.htm
But for some reason I can not get it to work. Is it something really obvious? My apologies if it is!
the code is here. Thank you:
Code:import rita.*;
RiText[] rts;
RiGrammar grammar;
void setup()
{
size(650, 200);
rts = new RiText[3];
RiText.setDefaultAlignment(CENTER);
RiText.setDefaultFont("Helvetica-48.vlw");
rts[0] = new RiText(this, "click to", width/2, 85);
rts[1] = new RiText(this, "generate", width/2, 110);
rts[2] = new RiText(this, "a haiku", width/2, 135);
grammar = new RiGrammar(this, "haiku.g.rtf");
}
void draw()
{
background(100);
}
void mouseClicked()
{
String result = grammar.expand();
String[] lines = result.split("%");
for (int i = 0; i < rts.length; i++) {
rts[i].fadeToText(lines[i].trim(), 1.0f);
}
}