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

2017/1/22

Text size

Solomon Solomon

2017/1/22

#
public Label(String text) { GreenfootImage img = new GreenfootImage (text.length()*20, 400); img.drawString (text, 2, 30); setImage (img); } How can i change the text size here?
danpost danpost

2017/1/22

#
You would have to modify the size of the font used on the image to change the size when using 'drawString'. Much easier would be to use the GreenfootImage constructor for text:
GreenfootImage img = new GreenfootImage(text, 30, null, null); // adjust the '30' as desired
setImage(img);
Solomon Solomon

2017/1/22

#
nevermind i got it to work now thx
You need to login to post a reply.