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

Report as inappropriate.

MatheMagician
MatheMagician presents ...

2013/1/27

Fullscreen Demo

This is a small demo of making a full-screen scenario. It works best when you export your scenario to a jar. Just make your world a subclass of ScaleWorld and your actors, a subclass of ScaleActor. My goal with this was to make it where you could design your scenario for 600by400 for example, but have it change the numbers for you when it scales the screen. This (hopefully) means you can copy most of your code into the scenario, and it will turn out just the same. I have modified move(), setLocation(), addObject(), getX(), getY(), and and it also directly modifies the size of actor's images to make up for the scaling. Finally, if you want to use a method like getImage().getColorAt(130,150), you would use the scaleX() and scaleY() methods in the world class: i.e. getImage().getColorAt(((ScaleWorld)getWorld()).scaleX(130),((ScaleWorld)getWorld().)scaleY(150));

3572 views / 19 in the last 7 days

1 vote | 0 in the last 7 days

Tags: mouse game simulation demo with-source

This scenario is a member of: Tools


open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

A new version of this scenario was uploaded on Sun Jan 27 13:10:08 UTC 2013
A new version of this scenario was uploaded on Sun Jan 27 13:14:09 UTC 2013
KartoffelbrotKartoffelbrot

2013/7/24

Seems to become great. Maybe I will use it, when it's finished and when Tiny Tank is finished. Maybe it is possible to don't have to use the scaleX and scaleY methods, by using the original image and scale it afterwards again, so that you need only the method scaleImage(GreenfootImage image) which you have to use after changing the images. This would be easier, if you want to use old scenarios. Nice work!

Want to leave a comment? You must first log in.

Who likes this?

Kartoffelbrot