Hi
I've never worked in Processing before, but I'm familiar with Java. I'm writing a Tag Cloud.
Part of my code:
Code:String[] listOfWords={"horror","thriller","comedy","drama","action"};
int[] numberOfwords ={1,7,3,12,1};
void draw()
{
for(int i = 0; i < numberOfwords.length; i++)
{
int totalInt = numberOfwords[i];
if(totalInt <= 2)
{
fill(204);
textFont(fontA, 10);
text(listOfWords[i], 10, 110);
}
else if(totalInt > 2 && totalInt < 7)
{
fill(51);
textFont(fontA, 20);
text(listOfWords[i], 10, 70);
}
else
{
fill(0);
textFont(fontA, 30);
text(listOfWords[i], 10, 30);
}
}
}
How can I change the text() in order to display the words next to each other, because at the moment the same size words are placed on top of each other? I also want all the words to be displayed on one line, and to run onto the next line when that line is full.
i.e. I want the output to be:
drama thriller comedy action horrorAny help will be appreciated.
Thanks