GetMapEngineFrameRate
From Spheriki
Gets the map engine frame rate being used.
Contents |
[edit]
Usage
number GetMapEngineFrameRate();
[edit]
Examples
The variable font must contain a previously loaded Sphere Font object. This script should be placed in the render script of the map being tested, using the Sphere map editor.
font.drawText(0, font.getHeight(), "FPS: " + GetMapEngineFrameRate());
Press F11 while the map is running to compare this desired framerate to the actual frame rate of the map engine.
[edit]
Notes
- This function will only work while the map engine is running.
- The number returned by this function is determined by the
fpsparameter of the last MapEngine or SetMapEngineFrameRate call.
- GetMapEngineFrameRate can be useful if a continuous loop needs to be used to simulate free execution of the map engine inside a script loop. See UpdateMapEngine for an example of how this could be achieved.
[edit]
See also
- Sphere Font object
- Font.drawText()
- Font.getHeight()

