问题来实现曲线动画 [英] Problem to achieve curved animation
问题描述
可能重复:
的Android,移动位图沿路径?
我想通过一个弧形path.Is有可能在Android的移动图像?我搜索了很多,但我只能找到有关缩放,旋转和平移animation.So人有任何想法,请help.Is有可能在Android的?
I want to move an image through a curved path.Is it possible in android ? I searched a lot but i can only find about scale,rotate and translate animation.So anyone have any idea please help.Is it possible in android?
推荐答案
您可以做一个逐帧动画。您可以一步定位对象的步骤来创建曲线。这将是有限的重用,但你可以做到这一点。
You can do a Frame by Frame animation. You can position the object step by step to create a curve. That will be of limited reuse, but you can do it.
也可以编写自己的动画创造TweenAnimation的一个子类,可以沿曲线制作动画。如果你用好数学,能理解贝塞尔曲线,那么这可能是一个简单的选择。一旦你有一个类,你可以很容易地通过任何曲线路径动画,但它更多的工作。
Or you can write your own animation to create a subclass of TweenAnimation that can animate along a curve. If you're good with math and can understand bezier curves then that might be a straight forward option. Once you have that class you could easily animate across any curved path, but it's more work.
http://en.wikipedia.org/wiki/B%C3%A9zier_curve
下面是一些VB code:
Here's some VB code:
HTTP://www.$c$ctoad.com/vb_bezier.asp
下面是一些Java code:
Here's some Java code:
http://www.math.ubc.ca/~cass/ GFX / bezier.html
这篇关于问题来实现曲线动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!