I would like to draw on top of an image background (a .png file); however, I do not see the polygon despite not getting any warnings or errors. Below, in the MyWorld(), works but I do not have the file background.
For adding the .png as the background, I have...
Now, I have the file background but I cannot see any drawn polygons. Thoughts?
Private GreenfootImage bg = new GreenfootImage(getWidth(), getHeight()); //World is 700x365 setBackground(bg); bg.setColor(Color.GREEN); bg.fill(); bg.setColor(Color.RED); int[] xPts = {600,700,700}; int[] yPts = {200,180,235}; bg.drawPolygon(xPts, yPts, 3);
GreenfootImage bg = new GreenfootImage(getWidth(),getHeight()); setBackground("images/nPlayBG.png"); bg.fill(); bg.setColor(Color.RED); int[] xPts = {600,700,700}; int[] yPts = {200,180,235}; bg.drawPolygon(xPts, yPts, 3);