GetNumLayers

From Spheriki

Jump to: navigation, search

Gets the number of layers on the current map in the map engine.


Contents

Usage

number GetNumLayers();


Examples

The map engine must be loaded for this example to work. This script can go in the map render script, using the Sphere IDE's map editor. The variable font must contain a previously loaded Sphere Font object.

var num_layers = GetNumLayers();
font.drawText(0, 0, "This map has " + num_layers + " layers, from 0 to " + (num_layers - 1) + ".");


Notes

  • This function will only work while the map engine is running.
  • GetNumLayers() can be used to verify the range of layer indices for the other layer functions.


See also

Personal tools