GetLayerHeight

From Spheriki

Jump to: navigation, search

Get's the height of the specified layer in tiles.


Contents

Usage

number GetLayerHeight(layer);
  • layer Number, non-negative. Index of the layer to check the height of.


Examples

For this example to work, the variable f must have been previously loaded with a Sphere Font object. Place this in the renderscript of a map using the Sphere IDE map editor.

f.drawText(0, 0, "layer height (0) = " + GetLayerHeight(0));

This will show the height of the bottom layer of the map in the top-left corner of the screen.


Notes

  • The valid range of layers that this function will accept is between 0 (inclusive) and GetNumLayers() (exclusive).
  • The number returned by this function is the height of the currently loaded map in tiles, not pixels. To return the pixel height, find the pixel height of a single tile image and multiply it by the number returned by GetLayerHeight.
  • This function will only work while the map engine is running.


See also

Personal tools