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

Method Demo8

example/demo.cpp:184–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 view7->setRepeatMode(LottieView::RepeatMode::Reverse);
183 }
184 void Demo8(EvasApp *app, std::string &filePath) {
185 /* Transform + color */
186 view8.reset(new LottieView(app->evas()));
187 view8->setFilePath(filePath.c_str());
188 if (view8->player()) {
189 view8->player()->setValue<rlottie::Property::TrRotation>("Shape Layer 1.Ellipse 1",
190 [](const rlottie::FrameInfo& info) {
191 return info.curFrame() * 20;
192 });
193 view8->player()->setValue<rlottie::Property::TrScale>("Shape Layer 1.Ellipse 1",
194 [](const rlottie::FrameInfo& info) {
195 return rlottie::Size(50, 100 - info.curFrame());
196 });
197 view8->player()->setValue<rlottie::Property::TrPosition>("Shape Layer 1.Ellipse 1",
198 [](const rlottie::FrameInfo& info) {
199 return rlottie::Point(-20 + (double)info.curFrame()/2.0,
200 -20 + (double)info.curFrame()/2.0);
201 });
202 view8->player()->setValue<rlottie::Property::FillColor>("Shape Layer 1.Ellipse 1.Fill 1",
203 [](const rlottie::FrameInfo& info) {
204 if (info.curFrame() < 60 )
205 return rlottie::Color(0, 0, 1);
206 else {
207 return rlottie::Color(1, 0, 0);
208 }
209 });
210 }
211 view8->setPos(2100, 0);
212 view8->setSize(300, 300);
213 view8->show();
214 view8->play();
215 view8->loop(true);
216 view8->setRepeatMode(LottieView::RepeatMode::Reverse);
217 }
218private:
219 std::unique_ptr<LottieView> view1;
220 std::unique_ptr<LottieView> view2;

Callers

nothing calls this directly

Calls 14

PointClass · 0.85
evasMethod · 0.80
setFilePathMethod · 0.80
curFrameMethod · 0.80
setSizeMethod · 0.80
playMethod · 0.80
setRepeatModeMethod · 0.80
SizeClass · 0.50
ColorClass · 0.50
resetMethod · 0.45
playerMethod · 0.45
setPosMethod · 0.45

Tested by

no test coverage detected