Hello,
this is the code to set up my score counter:
and this is the code to place it in the world:
If the score counter is below 10 it is centered, but if it goes above 10 it is slightly moved to the right.
Is there a way to fix this?
Thanks
1 2 3 4 5 6 7 8 | GreenfootImage img = new GreenfootImage( 500 , 100 ); img.setColor( new Color( 0 , 0 , 0 , 0 )); img.fill(); img.setColor(Color.WHITE); img.setFont( new Font( "Edit Undo Line BRK" , false , false , 95 )); img.drawString( "" +hitscore, 10 , 90 ); img.scale( 300 , 75 ); setImage(img); |
1 2 3 4 | private void prepareHitCounter() { addObject(hitcounter, 579 , 83 ); } |