Skip to content
Advertisement

PixiJS – Setting a Fixed Frame Rate

As the title says, how do you set a fixed frame rate of 25 fps for PixiJS?

Here is my setup:

JavaScript

I do not want to do any more frames than that.

Advertisement

Answer

After @wavemode’s comments about PixiJS using requestAnimationFrame I think I may have to do the following. (Note: if there is a better solution, please post it, otherwise I will mark this as the answer.)

Basically, stop any animation if we are exceeding the frame rate.

JavaScript

Then later on when we set up the animation:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement