SetLayerAngle

From Spheriki

Jump to: navigation, search

Sets a layer to be drawn at a given angle.


Contents

Usage

SetLayerAngle(layer, angle);
  • layer Number, non-negative. Index of the layer to set the angle of.
  • angle Number. The angle to set, in radians.


Examples

This example assumes you have at least two layers on the currently loaded map.

SetLayerAngle(1, Math.PI * 1.5);

The above example turns the layer with index one (1) on its right side (i.e. 3 / 2 radians, or 270 degrees.)


Notes

  • Naturally, this function only makes sense when the map engine is running.
  • Like all functions that deal with angles, the angle is required to be in radians. Converting between radians and degrees is trivial.
  • To find out the currently-set angle of a layer, use GetLayerAngle().
  • The range of valid layer indices goes from zero (0) to GetNumLayers() - 1 inclusive.


See also

Personal tools