6.frameRate()
Name(名称):frameRate()//帧速率
Examples(例子):
void setup() {
frameRate(4);
}
int pos = 0;
void draw() {
background(204);
pos++;
line(pos, 20, pos, 80);
if (pos > width) {
pos = 0;
}
}
Description(描述):Specifies the number of frames to be displayed every second. For example, the function call frameRate(30) will attempt to refresh 30 times a second. If the processor is not fast enough to maintain the specified rate, the frame rate will not be achieved. Setting the frame rate within setup() is recommended. The default rate is 60 frames per second.
指定每秒显示的帧数。例如,函数调用frameRate(30)将尝试每秒刷新30次。如果处理器的速度不够快,无法保持指定的速率,那么帧速率将无法实现。建议在setup()内设置帧速率。默认的速率是每秒60帧。
Syntax(语法):frameRate(fps)
Parameters (参数):fps——number of desired frames per second每秒需要的帧数
Returns(返回值):void
Related(相关函数):frameRate
- 本文固定链接: http://iprocessing.cn/2017/07/03/framerate帧速率函数/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表