I'm sure a lot of the OG's here remember that project back in (I think) 2013 that would automatically convert your greenfoot projects to fullscreen.
Currently, I'm trying to update the code. I got all the basic stuff done, like changing java.awt.Color to greenfoot.Color.
I also changed the line
to
Since there's no getSnapShot method anymore.
At this point, if I comment out all the other errors, it's go fullscreen nicely...until I change worlds.
The other errors that I'm stumped on are 1)
and 2)
1) Apparently, GreenfootFrame was a subclass of java.awt.Window(?) javax.swing.JFrame. What's the equivalent to GreenfootFrame now? What Greenfoot class displays the window?
2) I'm not even sure what the WorldCanvas even did. It sounds like it would be the same as getSnapShot(), but apparently the method returned a java.awt.Component. Edit: it was a subclass of a javax.swing.JPanel.
I'm not sure if what I'm doing is in vain or not. Maybe Dan might have a clue ;)
1 | BufferedImage bgImage = WorldHandler.getInstance().getSnapShot(); |
1 2 3 4 5 6 7 | GreenfootImage main = new GreenfootImage(getBackground()); for (Object obj : getObjects( null )) { Actor actor = (Actor) obj; main.drawImage(actor.getImage(), actor.getX()-actor.getImage().getWidth()/ 2 , actor.getY()-actor.getImage().getHeight()/ 2 ); } BufferedImage bgImage = main.getAwtImage(); |
1 | greenfoot.gui.GreenfootFrame |
1 | WorldHandler.getInstance().getWorldCanvas(); |