Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to achieve fluid animation in Android

I want to apply little tricky fluid ink animation as same as the below image:

enter image description here

I want to achieve using the basic classes only like applying scale, translate etc. I don't want to go with 2D or 3D. As I have checked some of the links they are suggesting frame animation but It doesn't have smooth transition.

Kindly suggest best way to achieve this animation.

Thanks,

like image 817
Jai Avatar asked Jan 03 '16 14:01

Jai


2 Answers

"I don't want to go with 2D or 3D."

Well.. I don't know about you but those are the only options until we have 4D screens and mindsets.

But I guess you mean using 2D images or 3D models.

Unless you want to procedurally generate that (which can be quite a pain) I'd suggest using a spritesheet, there may be better ways to do this but I think a spritesheet on 30fps might be the easiest + fluid way to do this, increase FPS to increase fluidness (until the max of androids 60 fps screens)

Basically:

Create a (example) 256x128 sprite, and "manually" animate the sphere to the other side of the image, saving each "frame" and either create 1 big texture with all the frames (most efficient) or save each frame independently (lower on RAM if you manage it well, but it'll be hard to get 60 fps with this due to loading times)

like image 111
Themperror Avatar answered Oct 22 '22 00:10

Themperror


You can check the recently announced Lottie library (by Airbnb). It is a library for Android that parses Adobe After Effects animations exported as json with Bodymovin (related project) and renders them natively on Android devices.

like image 36
josem Avatar answered Oct 22 '22 00:10

josem