setFramesPerSecond Method

This command causes the Accelerated Canvas App Game Interface to draw itself to its view a particular number of times per second.

intel.xdk.canvas.setFramesPerSecond(framesPerSecond);

Description:

Normally, you should call context.present as part of your run loop in your Accelerated Canvas App Game Interface component. However, this is an alternative which causes the Accelerated Canvas App Game Interface to draw itself to it’s view fps times per second. Note that the Impact plugin calls context.present internally as part of the run loop, so Impact apps should not call setFramesPerSecond or context.present.

Available Platforms:

Parameters:

framesPerSecond: A numeric value indicating how often the Accelerated Canvas App Game Interface should draw itself per second.

Example:

intel.xdk.canvas.setFramesPerSecond(12);
For more complete information about compiler optimizations, see our Optimization Notice.