本文介绍了如何在canvas中动画一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用画布来动画一行。我想使用TimelineLite来处理动画。我该怎么做?我知道在TimelineLite,时间线看起来像这样:
I am trying to animate a line using canvas. I want to use TimelineLite to handle the animation. How would I do this? I know that in TimelineLite, the Timelines look like this:
c>下的 x1 和 y1 code>函数。然后使用 TimelineMax $ c $,使它们向 x2 和 y2 c>这发生在 populateTimeline(); 函数中。The trick is to introduce two new variables into each Line of your animatedLines, namely destX and destY, and set their initial values to that of your x1 and y1 respectively, defined under the initLines(); function. And then make them increment towards your x2 and y2 values using TimelineMax which happens in the populateTimeline(); function.
继续看看进一步。
Hope这对你有所帮助。
Hope this is helpful to you in some way.
这篇关于如何在canvas中动画一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!