Giter Site home page Giter Site logo

tencent / fanvas Goto Github PK

View Code? Open in Web Editor NEW
546.0 546.0 196.0 7.53 MB

Fanvas,一键把swf转为html5 canvas动画。 Fanvas is a tool which can turn flash into canvas animation with just one key!

License: Other

ActionScript 56.84% JavaScript 34.97% HTML 0.68% AngelScript 7.50%

fanvas's People

Contributors

iazrael avatar kenkofox avatar kenkozheng avatar tencent-adm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fanvas's Issues

报错:Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.

我用fanvas转换某个swf后,得到如下错误:
Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
fanvas
错误定位到fanvas3-all.js的1263行代码的drawImage。使用如下方式可以规避问题:

cacheCanvas.width = cacheCanvas.width || 1;
cacheCanvas.height = cacheCanvas.height || 1;
ctx.drawImage(cacheCanvas, offX, offY, cacheCanvas.width/scale, cacheCanvas.height/scale);

能请问导致这个问题的原因是什么吗?

使用工具报错?

@kenkozheng

报错信息如下:

fanvas3-min.js:14 Uncaught TypeError: Failed to execute 'createPattern' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)'

按照项目中的Demo把script标签都放到了head标签中,同时写了定时器

查询错误之后发现可能是图片还没有加载结束就调用函数的原因,但是不知道该如何解决。求教

请问我可以认为 frameActionList 的长度就是动画的实际帧数吗?

UPDATE:
刚发现有这个: totalFrames 。

我想在动画播放结束后做一些操作,但目前没有对应的参数。唯一的回调就是 onFrame . 如果 frameActionList 的长度就是实际的总帧数,我就可以:

onFrame: function() {
  if (frame >= frameActionList.length) {
    // ...
  }
}

谢谢。

如何让导出的canvas动画透明?

有开发者提出,导出后的canvas动画默认使用了flash中的舞台颜色,如何实现透明,跟web其他元素叠加?

方法:
fanvas暂时没有加背景透明的配置,不过,大家可以在导出的swfData中,找到bgColor这个属性,删除或者设置为null,就能实现透明背景。
建议实际实现,可以在传入fanvas.play前,使用swfData.bgColor = null,这样的方式。

导出data.js如何导出

看了使用说明,打开flashplayer_14_sa_debug.exe,导入swf文件,之后导出data.js,但是flashplayer没有导出的按钮,这个要如何导出

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.