javascript 选择哪个画布框架,为什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16336575/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 04:14:39  来源:igfitidea点击:

Which canvas framework to choose and why?

javascripthtmlcanvasframeworks

提问by holyredbeard

I'm about to create something similar to this: http://platogo.com/avatars, which I'll do with Javascript and HTML5 with canvas.

我将要创建与此类似的内容:http: //platogo.com/avatars,我将使用 Javascript 和 HTML5 与画布进行操作。

Instead of buttons to change the appearance I want the user to be able to change the the character with the mouse (point, click, drag).

我希望用户能够使用鼠标(指向、单击、拖动)来更改角色,而不是更改外观的按钮。

I've been checking out different kinds of canvas frameworks that will make it easier to implement what I want to do. The ones I've found most interesting so far is fabric.jsand paper.js.

我一直在检查不同类型的画布框架,它们可以更轻松地实现我想做的事情。到目前为止,我发现最有趣的是fabric.jspaper.js

I would like suggestions of which framework would be most suitable for this task and readily an explanation why.

我想建议哪个框架最适合这项任务,并很容易地解释原因。

Thanks a lot!

非常感谢!

回答by markE

I'll make this quick because your “what's best” question will probably be closed or moved to the “programmers” site: https://softwareengineering.stackexchange.com/

我会尽快解决这个问题,因为您的“什么是最好的”问题可能会被关闭或移至“程序员”站点:https: //softwareengineering.stackexchange.com/

If you're just doing a “1-time, just get it knocked out and move-on” project, go to William Malone's excellent canvas tutorial that does exactly what you need: http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app/

如果你只是在做一个“1 次,把它淘汰并继续”项目,去威廉马龙的优秀画布教程,这正是你需要的:http: //www.williammalone.com/articles/ create-html5-canvas-javascript-drawing-app/

[edit: additional tutorial]

[编辑:附加教程]

I just realized this tutorial was on a separate page from the tutorial. Be sure to look at this too--it's right on point: http://www.williammalone.com/projects/html5-canvas-javascript-drawing-app-with-bucket-tool/

我刚刚意识到本教程与本教程位于不同的页面上。一定要看看这个——它是正确的:http: //www.williammalone.com/projects/html5-canvas-javascript-drawing-app-with-bucket-tool/

If you are using this project to learn canvas, then pleaseuse this opportunity to write this using canvas API rather than a canvas library. You have chosen an idealproject to learn and experiment with canvas. Take William Malone's examples and use this excellent reference+examples of the canvas API found at: http://www.html5canvastutorials.com/tutorials/html5-canvas-tutorials-introduction/

如果您正在使用这个项目来学习画布,那么利用这个机会使用画布 API 而不是画布库来编写它。您选择了一个理想的项目来学习和试验画布。以 William Malone 的例子为例,并使用这个优秀的参考 + 画布 API 的例子:http: //www.html5canvastutorials.com/tutorials/html5-canvas-tutorials-introduction/

Good coding….!

良好的编码....!

回答by Jarrod

http://kineticjs.com/Is pretty popular framework. Probably the best thing about it is the community support.

http://kineticjs.com/是非常流行的框架。可能最好的事情是社区支持。

Might be worth learning if you plan to continue with html5 canvas.

如果您打算继续使用 html5 画布,可能值得学习。

回答by Prasath K

You can go for fabric.jsinstead of paper.js

你可以去fabric.js代替paper.js

Reason : In SO , totally 167questions asked this year under the tag fabric.jswhereas , in paper.jsonly 43questions asked this year which says that most of the users prefer fabric.jsas it has more features

原因:在 SO 中,今年共有167 个问题在标签下提出,fabric.js而今年paper.js仅提出43 个问题,这表明大多数用户更喜欢fabric.js它,因为它具有更多功能