views:

128

answers:

1

Hi

I am working with android, trying to animate some text (make it bigger and smaller over time) and I have the following issue. I cant animate the text using the following:

int textSize = calculateTextSize();

paint.setTextSize(textSize);

canvas.drawText("Some Text", 10, 25, paint);

calculateTextSize , shrinks or enlarge the text size over time.

The issue is that the text doesnt animate, but 'jumps' over from size 20, to 19 to 18, etc Its not an animation, but changing the text of sizes.

How I can animate text on the canvas on andriod?

Thanks

A: 

You should use Canvas.scale() instead. This will let you do smooth animations.

Romain Guy
thanks, one follow up question. is it possible to do Android Animations on the LiveWallpaper (like the ones we can do on the activity) instead of doing all the calculations and drawing on the canvas? Thanks
Daniel Benedykt