Hi all,
I have a problem with this method:
This code should add the image of another Actor to another object, but it doesn't work.
Can anyone tell me what's wrong? Thanks!
public void addImageOfActor(Actor a) { GreenfootImage image = new GreenfootImage(getImage()); int width = Math.max(image.getWidth(), a.getImage().getWidth()); int height = Math.max(image.getHeight(), a.getImage().getHeight()); if (image.getWidth() < width || image.getHeight() < height) { image.scale(width, height); } image.drawImage(a.getImage(), 0, 0); setImage(image); }