lv_rlottie
lv_rlottie copied to clipboard
LVGL-widget for rlottie animation
trafficstars
Rlottie animation player for LVGL
Allows to use Rlottie animations in LVGL
Uses Samsung/rlottie library with C-api header
Compatible with LVGL main branch. Tested with the latest LVGL/master branch
Library simulator requires C++17-compatible compiler, CMake 3.14+ and Conan package manager
Get started
- Download or clone this repository
- Run
git submodule update --initfor fetching dependencies - Install conan package manager. Installations steps
- Add
bincrafterspackage source, run: conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
- Add
- Create directories for the corresponding build configuration. For instance, for MSVC x64DebugBuild the following structure should be prepared:
{project_directory}/build_simulator/x64-DebugTest
- Configure project
- navigate to the created
{project_directory}/build_simulator/x64-DebugTest - run
conan install ../.. - run
cmake -G"Visual Studio 16 2019" -Ax64 ../.. - run
cmake --build . - After the build navigate into
bindirectory and launch RlottieLvgl.exe
- navigate to the created
Use Rlottie from external file
lv_obj_t* rlottie_animation = lv_rlottie_create_from_file(parent,width,height, "Path/to/resource/insta_camera.json");
Use Rlottie from raw string data
//Create characters array for the image data
static const char FingerprintRaw[] ="{\"v\":\"5.1.16\",\"fr\":60,\"ip\":0,\"op\":154,\"w\":800,\"h\":600,\"nm\":\"Fingerprint... a lot of JSON items";
// Use it with corresponding API function
lv_obj_t* rlottie_anim_fingerprint_raw = lv_rlottie_create_from_raw(parent, width, height, FingerprintRaw);
JSON escaping
For using raw strings it's necessary to escape an image data. For this purpose the following escape tool can be used:
https://www.freeformatter.com/json-escape.html