GetNumLayers
From Spheriki
Gets the number of layers on the current map in the map engine.
Contents |
[edit]
Usage
number GetNumLayers();
[edit]
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) + ".");
[edit]
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.
[edit]
See also
- GetLayerHeight()
- GetLayerMask()
- GetLayerName()
- GetLayerWidth()
- IsLayerReflective()
- IsLayerVisible()
- MapEngine()
- SetLayerMask()
- SetLayerReflective()
- SetLayerVisible()
- Sphere Font object
- Font.drawText()

