From: subhransu mohanty Date: Tue, 15 Jan 2019 08:12:40 +0000 (+0900) Subject: lottie/example: Added image_test.json(resource with image resource ) X-Git-Tag: submit/tizen/20190116.045417^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/example: Added image_test.json(resource with image resource ) Change-Id: If79f5892347be0dcc850380f1520dfd0f2c70724 --- diff --git a/example/demo.cpp b/example/demo.cpp index 78f3fdd..9b14d55 100644 --- a/example/demo.cpp +++ b/example/demo.cpp @@ -45,21 +45,15 @@ main(void) 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); diff --git a/example/resource/image_test.json b/example/resource/image_test.json new file mode 100755 index 0000000..e60c955 --- /dev/null +++ b/example/resource/image_test.json @@ -0,0 +1 @@ +{"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 diff --git a/example/resource/images/img_0.png b/example/resource/images/img_0.png new file mode 100755 index 0000000..35ee257 Binary files /dev/null and b/example/resource/images/img_0.png differ