I'm trying to create a border around a circular object, and I wanted to know how I could make said border thicker when using the drawOval method.


1 2 3 4 5 6 7 8 9 10 11 | int borderSize = 10 ; // adjust as needed Color borderColor = Color.black; // adjust as needed GreenfootImage image = getImage(); int newWidth = image.getWidth()+ 2 *borderSize; int newHeight = image.getHeight()+ 2 *borderSize; GreenfootImage newImg = new GreenfootImage(newWidth, newHeight); newImg.setColor(borderColor); newImg.fillOval( 0 , 0 , newWidth- 1 , newHeight- 1 ); newImg.drawImage(image, borderSize, borderSize); setImage(newImg); |