This site requires JavaScript, please enable it in your browser!
Greenfoot back
R0mane
R0mane wrote ...

2017/9/20

Problem with scaling an image

R0mane R0mane

2017/9/20

#
Hello! I am creating a video game and I have a very basic problem. As I enter my image (.png) as an actor, it is too big. I tried to make it smaller with the method "scale", but nothing happens. Here is what I have done: public class Ground extends Actor { public void Ground() { GreenfootImage ground = getImage(); ground.scale(100, 100); setImage(ground); } } I compiled, there is no error, but my image stays exactly the same. I also tried using other images (including .jpg images), but Greenfoot doesn't accept .jpg images and other .png images aren't rescaled either... Can somebody help me, please?
Super_Hippo Super_Hippo

2017/9/20

#
Remove the 'void'.
You need to login to post a reply.