r2 - 07 Nov 2007 - 13:41:59 - WhaleForestYou are here: TWiki >  Processing Web > ProcessingHandbookChinese > Structure1CodeElementsFunctions

Functions 函数

函数允许你绘制图形,设置色彩,计算数据及其它各种功能。函数名字通常是小写后面加上一对括号,The comma-separated elements between the parentheses are called parameters, and they affect the way the function works. Some functions have no parameters and others have many.以下程序将介绍size()函数和background()函数。

//size函数有两个参数,第一个设置视觉视窗的宽度
//第二个设置视觉视窗的高度
size(200,200);

//此版本的background函数有一个参数
//它为视觉窗口设置色彩灰度
//在0(黑色)到255(白色)的范围
background(102);
    
1-02
Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback