Integrate Flash Animation (or Derived Format) on Fabric.js canvas

I have an animation with a transparent background and an HTML canvas.

Before adding an object to the canvas, an animation must be played.

The animation source is a Flash file, there is also an HTML / JS export (CreateJS) and an animated GIF.

The canvas uses Fabric.js, which runs inside a React application.

My question is this:

What is the recommended way to implement animation in the described use case?

Right now, my best approach would be to try to integrate CreateJS export into a React application and “overlay” Fabric.JS canvas with CreateJS canvas during animation playback. This solution could work and sound harder and bloat for me, since I would integrate another canvas library (CreateJS besides Fabric.js) and they should be synchronized in terms of synchronizing / playing the animation correctly.

Here is a similar unanswered question Animated GIF on Fabric.js Canvas

+4
source share
1 answer

fabric.js. , . , , fabric.js , , .

var canvas = new fabric.Canvas('c');
var imgElement = document.getElementById('my-image');
var imgInstance = new fabric.Image(imgElement, {
  left: 100,
  top: 100,
  angle: 30,
  opacity: 0.85
});
canvas.add(imgInstance);
-2

Source: https://habr.com/ru/post/1665601/


All Articles