I want to change the text at each line (text_1, text_2, etc.) and write it in a for loop.
I've seen a way of setting the image in the "Joy of Code" tutorials, and this was the example:
I tried to apply my idea in the same way, but it is not working as I want. Could you help me?
setImage("button" + imageNumber + ".png");
for (int i = 0; i < 9; i++)
{
text = text_ + i;
txt = new GreenfootImage(text, 24, Color.WHITE, transparent);
background.drawImage(txt, 20, y);
setImage(background);
txt.clear();
y += 30;
}

