simolus3 / fluttie

Easily display stunning Lottie animations in flutter apps with this plugin.
Other
453 stars 54 forks source link

Frame rate - Speed #8

Closed marianoarga closed 6 years ago

marianoarga commented 6 years ago

Hello, is it posible to adjust the frame rate of the animation from the plugin?

Thank you.

simolus3 commented 6 years ago

Hi. It's not possible to set the framerate directly, the plugin will rather figure it out based on what's specified in the composition file.

If you open any of your animation json files (warning: they're huge and thus not fun to edit), you should see an "fr" property in the top level json object encoded there. I think most have a value of 30 there, but you can edit that it if you want to. However, especially when displaying multiple animations simultaneously, the hardware capability of the device will constrain the framerate, so keep that in mind as something like 60fps will be hard to reach.

Given that you can edit the framerate in the files, I think adding direct support for that in the library is not needed. But please let me know if that'd be helpful for you, it shouldn't be taking long to implement. If editing the file didn't improve the framerate, please also let me know because that would be a bug in the plugin. Thanks!

marianoarga commented 6 years ago

I didn't test raising the frame rate since I needed to lower the animation speed, but the change in the json worked like a charm for what I needed. NOTE: You have to "flutter clean" to discard the asset cache and see the change take effect.

Thanks for your support.