You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For web, the canvas element is passed as argument to CanvasTexture.
In react-native, since there is no HTMLCanvasElement to pass, I am guessing I could use Texture class instead, grab a snapshot of the animation frames and pass it as png image...?
How can I grab snapshots of the Lottie animation frames in react-native? Or is there another way of passing the lottie animation as a texture? I am using expo-gl implementation of WebGL with ThreeJs. Any tips appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
ThreeJs has a LottieLoader class with can turn a lottie animation into a texture for geometry.
sample
sample code
LottieLoader class
For web, the canvas element is passed as argument to CanvasTexture.
In react-native, since there is no HTMLCanvasElement to pass, I am guessing I could use Texture class instead, grab a snapshot of the animation frames and pass it as png image...?
How can I grab snapshots of the Lottie animation frames in react-native? Or is there another way of passing the lottie animation as a texture? I am using expo-gl implementation of WebGL with ThreeJs. Any tips appreciated.
Beta Was this translation helpful? Give feedback.
All reactions