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

2021/2/22

Change the image of an Object

lil.bopp lil.bopp

2021/2/22

#
So, I want to change the image of an object. My teacher told us about methods that are already part of the Greenfoot-program? In a previous task, I had to implement a sound to be played with one of those methods (
Greenfoot.playSound("sound.wav")
). Now I'm thinking, to change the Image of the Object there must be a similar method inside of Greenfoot ? The question is, how such a method could look like. I've already tried
class.setImage(new GreenfootImage("image.png"))
"class" here meaning the name of the class. I hope my problem is somewhat understandable and someone can help :I Thanks in advance
lil.bopp lil.bopp

2021/2/22

#
Uh sorri, I found out myself xd It's literally just
setImage("image.png")
well still thank you, and if this helped someone else, that's just better :p
You need to login to post a reply.