If you are just trying to create a text image use 'GreenfootImage img = new GreenfootImage("This is my text.",fontSize, foreColor, backColor);' where fontSize can be a literal integer or a assigned variable integer, and foreColor and backColor are literal Colors or assigned variable Colors. If you are trying to apply text to an already created image use 'alreadyCreatedImageName.drawString("This is also my text", xLocation, yLocation);' where alreadyCreatedImageName is the name you gave the image for which you want to apply text to, and xLocation and yLocation are integer literals or assigned variable integers.
Also, the text can be a literal, as I show here, or an assigned variable String.