I have a canvas with two lines of text on it. I want to animate these 2 lines differently. How to do this?
How ca开发者_运维技巧n i only animated one line of text without clearing the whole screen?
Instead of clearing the whole screen you can attempt to clear just a rectangle around the text and redraw the text. Depending on what is behind the text, this could get tricky.
What may be cleaner, depending on your application, would be to have two canvases: one for the lines of text and one for the proper canvas (Which would be everything else you're drawing).
Then clear the text-only canvas and redraw it as you please to animate, leaving the normal canvas alone.
精彩评论