Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An alternative solution using PIXI.Texture #25

Open
borg opened this issue Sep 17, 2020 · 1 comment
Open

An alternative solution using PIXI.Texture #25

borg opened this issue Sep 17, 2020 · 1 comment

Comments

@borg
Copy link

borg commented Sep 17, 2020

I was trying to get this library to work within react but ran into a bunch of issues. Instead I found as long as you use lottie renderer='canvas' it's possible to capture it as a texture and put it straight into a PIXI graphics/sprite. Just posting if someone else it looking for a solution.

let anim = document.getElementById('lottieCanvas'); 
if(anim){
this.texture = PIXI.Texture.from(anim); 
this.texture.update();//needs to be updated each frame to get animation
var sprite = new PIXI.Sprite(this.texture);
 } 
@fluffy-heinzelman
Copy link

@borg I can't imagine that's a good way to go if you have a lot of animations and want reasonably good performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants