ITPub博客

首页 > IT职业 > IT生活 > Learning Processing.js - 1

Learning Processing.js - 1

IT生活 作者:skylar 时间:2021-09-09 09:41:49 0 删除 编辑

Learning Processing.js - 1

Processing.js is an open programming language for people who want to program images, animation, and interactions for the web without using Flash or Java applets. Processing.js uses Javascript to draw shapes and manipulate images on the HTML5 Canvas element.

 

Basic Syntax:

As with any language, you begin by defining your global variables. Then you create a setup() function, where you control the visualization’s properties, like the canvas size, frame rate and perhaps variables such as the stoke-weight or background-color.

The next step is to create your draw() function, which controls the behavior of each frame in your animation. The draw function loops continuously unless you tell it otherwise by using the exit() command.

Following is my first Processing.js example:

                              

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4648/viewspace-2806193/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-13

  • 博文量
    83
  • 访问量
    767