MCPcopy Create free account
hub / github.com/Samsung/rlottie / Demo

Class Demo

example/demo.cpp:31–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29using namespace std;
30
31class Demo
32{
33public:
34 Demo(EvasApp *app, std::string &filePath) {
35 Demo1(app, filePath);
36 Demo2(app, filePath);
37 Demo3(app, filePath);
38 Demo4(app, filePath);
39 Demo5(app, filePath);
40 Demo6(app, filePath);
41 Demo7(app, filePath);
42 Demo8(app, filePath);
43 }
44 void Demo1(EvasApp *app, std::string &filePath) {
45 /* Fill Color */
46 view1.reset(new LottieView(app->evas()));
47 view1->setFilePath(filePath.c_str());
48 if (view1->player()) {
49 view1->player()->setValue<rlottie::Property::FillColor>("Shape Layer 1.Ellipse 1.Fill 1",
50 [](const rlottie::FrameInfo& info) {
51 if (info.curFrame() < 60 )
52 return rlottie::Color(0, 0, 1);
53 else {
54 return rlottie::Color(1, 0, 0);
55 }
56 });
57 }
58 view1->setPos(0, 0);
59 view1->setSize(300, 300);
60 view1->show();
61 view1->play();
62 view1->loop(true);
63 view1->setRepeatMode(LottieView::RepeatMode::Reverse);
64 }
65
66 void Demo2(EvasApp *app, std::string &filePath) {
67 /* Stroke Opacity */
68 view2.reset(new LottieView(app->evas()));
69 view2->setFilePath(filePath.c_str());
70 if (view2->player()) {
71 view2->player()->setValue<rlottie::Property::StrokeOpacity>("Shape Layer 2.Shape 1.Stroke 1",
72 [](const rlottie::FrameInfo& info) {
73 if (info.curFrame() < 60 )
74 return 20;
75 else {
76 return 100;
77 }
78 });
79 }
80 view2->setPos(300, 0);
81 view2->setSize(300, 300);
82 view2->show();
83 view2->play();
84 view2->loop(true);
85 view2->setRepeatMode(LottieView::RepeatMode::Reverse);
86 }
87
88 void Demo3(EvasApp *app, std::string &filePath) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected