0.9.2 • Published 1 year ago

@oasis-engine/lottie v0.9.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Oasis Lottie

npm-size npm-download

This is a lottie runtime created by oasis engine. Currently, It can only render sprite elements in the lottie tree. It is high-performance owing to drawing all sprites in batch, which is different from svg or canvas renderer of lottie-web. See more info: documentation.

Features

  • Sprite element: transform and opacity animation.
  • 3D rotation: rotate element in 3D space.
  • Animation clip: play animation clip.

TODO

  • Sprite mask
  • Shape element
  • Text
  • Expression

Usage

Before using the code below, you should transform original lottie JSON file ( images must be base64-encoding strings) to oasis standard lottie files. It's convenient to complete the task with tool-atlas-lottie which will generate a folder which contains three files: a processed lottie JSON file, an atlas file and an image.

import { LottieAnimation } from "@oasis-engine/lottie";

// Load lottie json、atlas file with engine's `resourceManager`
engine.resourceManager.load({
  urls: [
    "https://gw.alipayobjects.com/os/bmw-prod/b46be138-e48b-4957-8071-7229661aba53.json",
    "https://gw.alipayobjects.com/os/bmw-prod/6447fc36-db32-4834-9579-24fe33534f55.atlas"
  ],
  type: 'lottie'
}).then((lottieEntity) => {
  // Add lottie entity created to scene 
  root.addChild(lottieEntity);

  // Get `LottieAnimation` component and play the animation
  const lottie = lottieEntity.getComponent(LottieAnimation);
  lottie.isLooping = true;
  lottie.speed = 1;
  lottie.play();
});

Install

npm i @oasis-engine/lottie --save

Contributing

This project is work-in-progress. Everyone is welcome to create issues or submit pull requests. Make sure to read the Contributing Guide before submitting changes.

Dev

1.Clone this repository and install the dependencies:

npm i

2.Run the example:

npm run example

License

MIT

0.9.0

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.8.3

2 years ago

0.8.3-test.0

2 years ago

0.8.3-test.1

2 years ago

0.8.3-beta.3

2 years ago

0.8.3-beta.2

2 years ago

0.8.3-beta.1

2 years ago

0.8.3-beta.0

2 years ago

0.8.2

2 years ago

0.7.2

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.10

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.13

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.6.9

2 years ago

0.6.8

2 years ago

0.6.0-alpha.0

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6-alpha.5

3 years ago

0.0.6

3 years ago

0.0.6-alpha.3

3 years ago

0.0.6-alpha.4

3 years ago

0.0.6-alpha.0

3 years ago

0.0.6-alpha.1

3 years ago

0.0.6-alpha.2

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago