2

I'm currently developing 2D android game. And when I comes to score, I used canvas drawText method to display my current score in the middle of screen. I didn't use any layout xml file, my background is render by canvas. The position done by canvas. Everything canvas. Now, I want to display my next current score animates in when my score increase by one. Not just changing my value default pattern.

Paint Score_Paint = new Paint();
Score_Paint.setTextSize(dpToPx(50));
Score_Paint.setAntiAlias(true);
Score_Paint.setColor(RED);
Score_Paint.setTypeface(ARVO_BOLD);

//draw score
canvas.drawText("" + score, 
               (ScreenWidth() * 0.5f) - (Title_Paint.measureText("" + score) / 2), 
               (float) (ScreenHeight() * 0.35f), 
               Score_Paint);
user3691561
  • 31
  • 1
  • 3

0 Answers0