Is it possible to change the font size of showText(java.lang.String text, int x,int y) in the world class, or do i have to replace it with an actor showing text?
public class SimpleActor extends greenfoot.Actor {}// with an instance reference field to the actor
private Actor message = new SimpleActor();
// and with a method to update it image
public void setMessage(String text)
{
GreenfootImage image = null;
if (text != null && !"".equals(text)) image = new GreenfootImage(text, 28, null, null);
message.setImage(image);
}
// with something like this line in constructor
addObject(message, 100, 20);// in class to set a message
setMessage("Hello, world!");
// in class to clear a message
setMessage(null); // or 'setMessage("");'
// from Actor object in a world called MyWorld
((MyWorld)getWorld()).setMessage("Hola, mundo!");