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

2018/4/10

Setting the Background getWorld().setBackground(new GreenfootImage("nameOfImageFile.png")); not working.

RandomLittleWeeb RandomLittleWeeb

2018/4/10

#
Like in the title. I saw from a former post that in order to change the background u can use this command. getWorld().setBackground(new GreenfootImage("nameOfImageFile.png")); But when I use that in my code. (Yes my image has been verified and the name matches and it is in the images folder of the project. But it keeps saying it can't find the meth getWorld. Aside from that can u help me find the command where u can resize the picture.
danpost danpost

2018/4/11

#
Just use:
1
setBackground(new GreenfootImage("nameOfImageFile.png"));
Only use getWorld if you are doing it from an Actor subclass.
RandomLittleWeeb RandomLittleWeeb

2018/4/16

#
Ok Thank you
danpost danpost

2018/4/17

#
RandomLittleWeeb wrote...
can u help me find the command where u can resize the picture.
You can resize a GreenfootImage object with the scale(int, int) method.
You need to login to post a reply.