首页 > 文档 > frameRate()帧速率函数
2017
07-03

frameRate()帧速率函数

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

frameCount

setup()

draw()

loop()

noLoop()

redraw()

 

 

 



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

留下一个回复

你的email不会被公开。