mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
Update README.md
This commit is contained in:
parent
4f9f125454
commit
3e8126ead9
1 changed files with 1 additions and 1 deletions
|
@ -258,7 +258,7 @@ picture->load("lottie.json"); //load a Lottie file
|
||||||
auto duration = animation->duration(); //figure out the animation duration time in seconds.
|
auto duration = animation->duration(); //figure out the animation duration time in seconds.
|
||||||
canvas->push(tvg::cast(picture)); //push the picture into the canvas
|
canvas->push(tvg::cast(picture)); //push the picture into the canvas
|
||||||
```
|
```
|
||||||
First, an animation and a picture are generated. The Lottie file (lottie.json) is loaded into the picture, and then the picture is added to the canvas. The animation frames are controlled using the animation object to play the Lottie animation.
|
First, an animation and a picture are generated. The Lottie file (lottie.json) is loaded into the picture, and then the picture is added to the canvas. The animation frames are controlled using the animation object to play the Lottie animation. Also you might want to know the animation duration time to run your animation loop.
|
||||||
```cpp
|
```cpp
|
||||||
animation->frame(animation->totalFrame() * progress); //Set a current animation frame to display
|
animation->frame(animation->totalFrame() * progress); //Set a current animation frame to display
|
||||||
canvas->update(animation->picture()); //Update the picture to be redrawn.
|
canvas->update(animation->picture()); //Update the picture to be redrawn.
|
||||||
|
|
Loading…
Add table
Reference in a new issue