eva-engine / eva.js

Eva.js is a front-end game engine specifically for creating interactive game projects.
https://eva.js.org
MIT License
1.75k stars 108 forks source link

直接复制lottie部分的官方demo代码,并没有办法出现lottie,并且也不会去加载lottie的json资源 #73

Closed strawberry3269 closed 3 years ago

strawberry3269 commented 3 years ago

Expected Behavior

出现lottie播放的场景

Current Behavior

Possible Solution

Steps to Reproduce

Environment

import { Game, GameObject, resource } from '@eva/eva.js' import { RendererSystem } from '@eva/plugin-renderer' import { LottieSystem, Lottie } from '@eva/plugin-renderer-lottie'

const game = new Game({ systems: [ new RendererSystem({ canvas: document.querySelector('#canvas'), width: 750, height: 1624 }), new LottieSystem() ], autoStart: true, frameRate: 60 })

resource.addResource([ { name: 'ResourceName', type: 'LOTTIE', src: { json: { type: 'json', url: 'https://gw.alipayobjects.com/os/bmw-prod/61d9cc77-12de-47a7-b6e5-06c836ce7083.json' } } } ])

const LottieComponent = new Lottie({ resource: 'ResourceName' }) const LottieGameObject = new GameObject('ResourceName', {})

LottieGameObject.addComponent(LottieComponent) game.scene.addChild(LottieGameObject)

fanmingfei commented 3 years ago

https://github.com/eva-engine/eva-engine.github.io/commit/ee96dad627b1bdfa7ffcfd65b75f160d9aed7b7f