开发者

canvas animation of text

开发者 https://www.devze.com 2023-01-15 08:43 出处:网络
I have a canvas with two lines of text on it. I want to animate these 2 lines differently. How to do this?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号