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

2013/3/16

Simple question about text.

sqwuckies sqwuckies

2013/3/16

#
In my world class, no matter what I set the font size parameter to, it always displays the text at about a 1 pixel height. Unreadable!
getBackground().setFont(new Font("Arial", 600, Font.BOLD));
getBackground().drawString("THUNDERSHOCK", 200, 200);  
Gevater_Tod4711 Gevater_Tod4711

2013/3/16

#
That probably occures because you arent using a size of 600 but a size of whatever Font.BOLD returns. If you exchange the 600 and Font.BOLD it'll work.
sqwuckies sqwuckies

2013/3/16

#
Gevater_Tod4711 wrote...
That probably occures because you arent using a size of 600 but a size of whatever Font.BOLD returns. If you exchange the 600 and Font.BOLD it'll work.
You mean remove Font.BOLD? If so, that's a good thing because I don't need it at all, I would just like my text to be styled normally. EDIT: I see what you mean now, and it works. But how do I make it so it's not bold but regular styling?
Gevater_Tod4711 Gevater_Tod4711

2013/3/16

#
I think the field Font.PLAIN is a 'normal' font.
You need to login to post a reply.