Hey guys, I am new to Greenfoot. I am working in one game the same as 2048. The problem is I don't want the boxes to have sharp edges and I couldn't find the way to set round edges to the rectangles.
this is my code
Thanks in advance!
1 2 3 4 5 6 7 8 9 10 11 12 13 | // create the text image int fontsize = 28 ; // change as desired Color fontColor = Color.WHITE; // change as desired Color bgColor = new Color( 255 , 255 , 255 , 1 ); // transparent background GreenfootImage txtImg = new GreenfootImage(text, fontsize, fontColor, bgColor); // create the base image GreenfootImage img = new GreenfootImage( 62 , 62 ); bgColor = Color.BLUE; // change as desired img.setColor(bgColor); img.fill(); // draw text image on base image img.drawImage(txtImg, 20 , 5 ); setImage(img); |