How do I import my own image (saved on my desktop) into the Greenfoot application?
GreenfootImage image = new GreenfootImage("YourImagesName.type");
public class YourClass extends Actor { public YourClass() { setImage(new GreenfootImage("YourImage.type")); } }
public class YourClass extends Actor { private GreenfootImage image = new GreenfootImage("YourImage.type"); }
{ GreenfootImage image = getImage(); image.scale(image.getWidth() - 1, image.getHeight() - 1); setImage(image); }
GreenfootImage image = getImage(); image.scale(image.getWidth()/2, image.getHeight()/2);