app->setup();
std::string filePath = DEMO_DIR;
- filePath +="mask.json";
-
- std::ifstream f;
- f.open(filePath);
- std::stringstream buf;
- buf << f.rdbuf();
- f.close();
+ filePath +="image_test.json";
LottieView *view = new LottieView(app->evas());
- view->loadFromData(buf.str().data(), "test_key");
+ view->setFilePath(filePath.c_str());
view->setPos(0, 0);
view->setSize(800, 800);
view->show();
- view->setMinProgress(0.5);
- view->setMaxProgress(0.0);
+// view->setMinProgress(0.5);
+// view->setMaxProgress(0.0);
view->play();
view->loop(true);
view->setRepeatMode(LottieView::RepeatMode::Reverse);
--- /dev/null
+{"v":"5.4.3","fr":60,"ip":0,"op":60,"w":800,"h":800,"nm":"test","ddd":0,"assets":[{"id":"image_0","w":200,"h":300,"u":"images/","p":"img_0.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"img_0.png","cl":"png","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[56]},{"t":50}],"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2},"a":{"a":0,"k":[100,150,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[99,99,100],"e":[152,152,100]},{"t":50}],"ix":6}},"ao":0,"ip":0,"op":60,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file