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.
Ejemplos
Sintaxis
frameRate(fps)
frameRate()
Parámetros
number of frames to draw per second.
Referencias Relacionadas
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.