Sets the number of frames to draw per second.
Calling frameRate() with one numeric argument, as in frameRate(30), attempts to draw 30 frames per second (FPS). The target frame rate may not be achieved depending on the sketch's processing needs. Most computers default to a frame rate of 60 FPS. Frame rates of 24 FPS and above are fast enough for smooth animations.
Calling frameRate() without an argument returns the current frame rate. The value returned is an approximation.
예제
구문
frameRate(fps)
frameRate()
매개변수
number of frames to draw per second.
관련 레퍼런스
deltaTime
A Number variable that tracks the number of milliseconds it took to draw the last frame.
describeElement
Creates a screen reader-accessible description of elements in the canvas.
displayDensity
Returns the display's current pixel density.
displayHeight
A Number variable that stores the height of the screen display.