tencent / fanvas Goto Github PK
View Code? Open in Web Editor NEWFanvas,一键把swf转为html5 canvas动画。 Fanvas is a tool which can turn flash into canvas animation with just one key!
License: Other
Fanvas,一键把swf转为html5 canvas动画。 Fanvas is a tool which can turn flash into canvas animation with just one key!
License: Other
最近做一个项目,刚接触到这个工具,觉得完美,后边发现不能停留在最后一帧,一直循环播放,有点尬
我用fanvas转换某个swf后,得到如下错误:
Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
错误定位到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);
能请问导致这个问题的原因是什么吗?
不清楚Swiffy是否是后改成以swf文件作为输入的。
https://developers.google.com/swiffy/convert/upload?hl=zh-CN
看了使用说明,打开flashplayer_14_sa_debug.exe,导入swf文件,之后导出data.js,但是flashplayer没有导出的按钮,这个要如何导出
有开发者提出,导出后的canvas动画默认使用了flash中的舞台颜色,如何实现透明,跟web其他元素叠加?
方法:
fanvas暂时没有加背景透明的配置,不过,大家可以在导出的swfData中,找到bgColor这个属性,删除或者设置为null,就能实现透明背景。
建议实际实现,可以在传入fanvas.play前,使用swfData.bgColor = null,这样的方式。
UPDATE:
刚发现有这个: totalFrames 。
我想在动画播放结束后做一些操作,但目前没有对应的参数。唯一的回调就是 onFrame . 如果 frameActionList 的长度就是实际的总帧数,我就可以:
onFrame: function() {
if (frame >= frameActionList.length) {
// ...
}
}
谢谢。
不能支持as2.0中的按钮和文字,声音也没有,期待改进
报错信息如下:
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
标签中,同时写了定时器
查询错误之后发现可能是图片还没有加载结束就调用函数的原因,但是不知道该如何解决。求教
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.