Waving text on canvas

走远了吗. 提交于 2020-02-02 06:39:51

问题


How could I make waving text on a canvas element similar to what is found on this page?


回答1:


EDIT: @Ben, forget about the downvotes for no reason on your question, and... BE MY GUEST! :)

I never coded with <canvas> before, it was very fun. At this point, there is no bilinear interpolation. I might rework it and add more bells and whistles.


If you want to achieve such an effect in javascript, you'll effectively have to use the <canvas> tag.

The principle consists in precalculating a distortion function in a buffer that is larger than the source image dimension.

Have a look at the old Flipcode Art of Demomaking column: Bitmap Distortion. This is a good old gem :) The paragraph about the cache might not be relevant for a <canvas> based implementation though.

There are many Processing resources out there, so it's also a good idea to have a look at Processing.js.




回答2:


Please, for the sake of the internet, don't do it.



来源:https://stackoverflow.com/questions/2059130/waving-text-on-canvas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!