首页 > 文档 > settings()特殊情况下的设置
2017
07-03

settings()特殊情况下的设置

15.settings()

Name(名称):settings()//特殊情况下的设置

Examples(例子):

 

// Run code at full screen using the default renderer使用默认渲染器在全屏运行代码

int x = 0;

void settings() {

  fullScreen();

}

void setup() {

  background(0);

  noStroke();

  fill(102);

}

void draw() {

  rect(x, height*0.2, 1, height*0.6);

  x = x + 2;

}

 

 

 

Description描述):The settings() function is new with Processing 3.0. It’s not needed in most sketches. It’s only useful when it’s absolutely necessary to define the parameters to size() with a variable. Alternately, the settings() function is necessary when using Processing code outside of the Processing Development Environment (PDE). For example, when using the Eclipse code editor, it’s necessary to use settings() to define the size() and smooth() values for a sketch..

settings()函数是processing3.0的新功能。大多数草图都不需要它。只有在完全有必要将参数定义为size()时才有用。此外,当使用处理开发环境(PDE)之外的处理代码时,settings()函数是必要的。例如,在使用Eclipse代码编辑器时,必须使用settings()来定义草图的大小()和平滑()值。

The settings() method runs before the sketch has been set up, so other Processing functions cannot be used at that point. For instance, do not use loadImage() inside settings(). The settings() method runs “passively” to set a few variables, compared to the setup() command that call commands in the Processing API.

settings()方法在创建草图之前运行,因此在该点无法使用其他处理函数。例如,不要在settings()中使用loadImage()。与setup()命令在处理API中调用命令相比,settings()方法“被动”地设置一些变量。

Syntax(语法):settings()

Returns返回值):Void(

Related相关函数):fullScreen()
setup()
size()
smooth()

 

 

 



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。