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

2015/6/11

Text help

Gingervitis Gingervitis

2015/6/11

#
I'm trying to change the font size and font type for my project but how do I get it to display the font with the changes as part of a GreenfootImage? Here is what I have so far as well as current classes I imported.
import java.awt.font.*;
import java.awt.font.TextAttribute;
import java.text.AttributedString;
 message= "Round Completed!";
        AttributedString as = new AttributedString(message);
        as.addAttribute(TextAttribute.SIZE, 24);
        message = as.getIterator().getAttributes().toString();
danpost danpost

2015/6/11

#
You could use my TextImage Support Class which extends GreenfootImage. So, instead of creating GreenfootImage objects for text directly from that class you would create them through the TextImage class.
Gingervitis Gingervitis

2015/6/11

#
danpost wrote...
You could use my TextImage Support Class which extends GreenfootImage. So, instead of creating GreenfootImage objects for text directly from that class you would create them through the TextImage class.
Thank you so much danpost! This should be a big help for me.
You need to login to post a reply.