Backgrounds in Greenfoot

56 views
Skip to first unread message

Darius Nadem

unread,
Apr 21, 2015, 3:11:48 PM4/21/15
to greenfoot-dis...@googlegroups.com
Is it possible to incorporate a changing background such as a gif?

dodo...@hotmail.com

unread,
Apr 21, 2015, 3:16:57 PM4/21/15
to greenfoot-dis...@googlegroups.com
I think it's only png. Not too sure tho actually. 

░░░░░░░░░▄▄▄▄▄
░░░░░░░░▀▀▀██████▄▄▄
░░░░░░▄▄▄▄▄░░█████████▄ 
░░░░░▀▀▀▀█████▌░▀▐▄░▀▐█ 
░░░▀▀█████▄▄░▀██████▄██ 
░░░▀▄▄▄▄▄░░▀▀█▄▀█════█▀
░░░░░░░░▀▀▀▄░░▀▀███░▀░░░░░░▄▄
░░░░░▄███▀▀██▄████████▄░▄▀▀▀██▌
░░░██▀▄▄▄██▀▄███▀░▀▀████░░░░░▀█▄
▄▀▀▀▄██▄▀▀▌████▒▒▒▒▒▒███░░░░▌▄▄▀
▌░░░░▐▀████▐███▒▒▒▒▒▐██▌
▀▄░░▄▀░░░▀▀████▒▒▒▒▄██▀
░░▀▀░░░░░░▀▀█████████▀
░░░░░░░░▄▄██▀██████▀█
░░░░░░▄██▀░░░░░▀▀▀░░█
░░░░░▄█░░░░░░░░░░░░░▐▌
░▄▄▄▄█▌░░░░░░░░░░░░░░▀█▄▄▄▄▀▀▄
▌░░░░░▐░░░░░░░░░░░░░░░░▀▀▄▄▄▀

GOTTA GO FAST!


Luke

unread,
Apr 21, 2015, 3:18:10 PM4/21/15
to greenfoot-dis...@googlegroups.com

Justin Dai

unread,
Apr 21, 2015, 3:19:30 PM4/21/15
to greenfoot-dis...@googlegroups.com

5 Know which image file type to use

Many different image file formats exist: JPEG, GIF, PNG, BMP, TIFF, PICT, and many more. Greenfoot can read most of them, but not all are equally good to use.

The trade-off with image formats is usually between file size and quality. But there is also one other detail: Some image formats can have transparent areas (thus showing non-rectangular images) while others cannot.

PNGTo make the story short: The two image formats to use are PNG and JPEG. Anything else you can pretty much forget.

JPEG is very good at compressing image files to a small size. Small sizes are especially important if you want to export your scenario to the Greenfoot Gallery: The smaller the scenario files, the faster it is for you to upload your scenario and, more importantly, the faster the scenario starts for your users. So JPEG files are good for relatively large images if we want to save file size.

On the downside: JPEG compromises on quality. This does not make much of a difference in full colour images, but will become visible in images that have sharp lines on them (for instance, writing or line drawings). Look, for example, at the images on the right. While the PNG image looks fine, the JPEG image develops compression artefacts (“dirty” or “blurry” looking areas around the text). The other disadvantage is that JPEG does not do transparency, so if you want non-rectangular actors, this is a problem.
JPG
Luckily, PNG does both of this well. It has good quality for images, line drawings and text, and it can do transparent backgrounds. However, it does not compress as well as JPEG, especially on images with many colours.

Taken together, this means: Use JPEG files for scenario backgrounds – they are just about perfect for this, since we have fairly large images and don’t need transparency. Use PNGs for actors. That’s what I almost always use. The only exception is if I have hard lines or writing on the background – then I might use a PNG for the world background as well.

Found this at this page its at the bottom  

http://blogs.kent.ac.uk/mik/2008/12/my-top-five-greenfoot-coding-tips/


wiic...@gmail.com

unread,
Apr 21, 2015, 3:19:41 PM4/21/15
to greenfoot-dis...@googlegroups.com
PNG Can only be used for Backgrounds.

yungt...@gmail.com

unread,
Apr 21, 2015, 3:23:33 PM4/21/15
to greenfoot-dis...@googlegroups.com
Download and check the codes for these scenarios. They could help.
 
 
Reply all
Reply to author
Forward
0 new messages