gamvas.screen

Functions with info about the screen

Summary
gamvas.screenFunctions with info about the screen
Variables
frameLimitSets the maximum of rendertime in seconds until a frame is skipped.
Functions
getLastFrameLengthReturns the time elapsed since the last call to render a frame.
getFPSReturns the current frames per second.

Variables

frameLimit

frameLimit: 0.1

Description

Sets the maximum of rendertime in seconds until a frame is skipped.  To prevent hickups on performance bottlenecks.  So if you want to ensure a minimur of 30 frames per second you would set it to 1/30 = 0.033, but it is not recommended to set this value to low or your game will not work on slower systems.

Default

0.1

Functions

getLastFrameLength

getLastFrameLength: function()

Description

Returns the time elapsed since the last call to render a frame.

getFPS

getFPS: function()

Description

Returns the current frames per second.  Browsers try to run your game at 60 FPS.  If your game runs significantly slower you should try to enhance the performance.

Example

console.log(gamvas.screen.getFPS());
frameLimit: 0.1
Sets the maximum of rendertime in seconds until a frame is skipped.
getLastFrameLength: function()
Returns the time elapsed since the last call to render a frame.
getFPS: function()
Returns the current frames per second.
Close