Hey guys. I want to change my font size, but can't seem to find any working solutions in here, that fit my code. here's the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.awt.Color; public class Start extends Actor { private int score = 3 ; public Start() { score = 3 ; setImage( new GreenfootImage( "String " , 20 , Color.GREEN, Color.BLUE)); update(); } public void addScore() { score--; update(); } /** * Return the current counter value. */ public int getValue() { return score; } /** * Set a new counter value. */ public void setValue( int newValue) { score = newValue; update(); } public void update() { GreenfootImage img = getImage(); img.clear(); img.setColor(Color.BLACK); img.drawString ( "Lives:" + score, 3 , 20 ); } } |