Original Post
🔒 Locked
[java] AttributedString -- change text after constructor
Advertisement
I would just create my own class that displays the score by using g.drawImage()
For instance:
or simply use
g.drawString("This is the score: "+score, x,y,null);
For instance:
int score;BufferedImage[] numbers = SOME_ARRAY_OF_IMAGES;Char[] characters = String.valueof(score).toCharArray();int offset = 10;for(int i = 0; i < characters.length; i++) { if(characters=='0') {g.drawImage(numbers[0], SCREEN_WIDTH-offset*i, i, null);} //repeat for all the characters you want}or simply use
g.drawString("This is the score: "+score, x,y,null);
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement