0

Possible Duplicate:
Problem to achieve curved animation

Can I create my own Animation class which will move my image in a curved path? If anybody have any idea or link to any post then please help

Community
  • 1
  • 1
Android Killer
  • 18,174
  • 13
  • 67
  • 90

1 Answers1

0

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.

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

Here's some VB code:

http://www.codetoad.com/vb_bezier.asp

Here's some Java code:

http://www.math.ubc.ca/~cass/gfx/bezier.html

And also take a look at these questions

animate-image-along-path-on-android

Community
  • 1
  • 1
Hussain
  • 5,552
  • 4
  • 40
  • 50
  • Thanks hussain bhai.In your last link there is no solution for curved animation.And 3rd link is very very big and difficult to understand.I read it but i think it cannot be applied for android. – Android Killer Jul 28 '11 at 08:37