跳到主要内容

一种创建JavaScript的简单方法

处理+$is a brilliant programming language aimed at more at artists and designers than at coders. Designed to help non-programmers get started with programming, it makes it easy for get instant visual results from your code. It's possible to run Processing programs in a browser using Processing.js, but now there's an alternative in the form ofP5.js

+$Currently in beta, it's a JavaScript library that starts with the original Processing goal of accessible coding, but that enables you to create attractiveJavaScript示例+$that run directly in the browser.

You can create simple interactive apps like this with a few lines of code

+$You can create simple interactive apps like this with a few lines of code

+$Created by New York-based artist and programmer+$Lauren McCarthy+$and a team of contributors, p5.js is a software sketchbook for the web that features all of Processing's drawing functionality, but also lets you use add-on libraries to interact with HTML5 objects such as video and sound.

+$Long-time Processing Fan布兰登道斯+$has already been experimenting with p5.js, and has used it in conjunction with PhantomJS to generate a new sine wave-based header image for his Twitter account every hour. See how he did it这里

Brendan Dawes uses p5.js to generate these fab sine wave-based images for his Twitter account

+$Brendan Dawes uses p5.js to generate these fab sine wave-based images for his Twitter account

+$While it's a new interpretation of Processing rather than a straight port, it's easy to switch to pf.js and convert existing Processing projects to p5.js; there are instructions on the site. There's also an official editing environment on the way; if you have a Mac you can download an alpha version today. Otherwise you can simply use your preferred文本编辑器+$; there are instructions for setting p5.js up with Sublime Text 2 on the site, along with loads of tutorials and code examples to help you get started.



翻译字数超限