Surface.rotate
From Spheriki
Rotates the surface anticlockwise about the given angle in radians.
Contents |
Usage
- angle Number, between 0 and 2 * Math.PI. The angle in which to rotate the surface.
- resize Boolean. True if you want to surface to resize so that the rotated image will fit afterwards, false if you wish to retain the current dimensions of the image.
Examples
ed: Feel free to add an example for this function, by editing this wiki page.
Notes
- Like all Sphere functions that work with angles, the angle returned by this function is in the form of radians. To convert between radians and degrees, use Math.js (system script), or write your own simple routines.
- Angles are measured as zero radians pointing to the right, and then increasing anticlockwise.
- This function will modify the original surface, so you may wish to clone the surface using Surface.clone() beforehand.
- Unlike Image.rotateBlit(), this function will change the surface itself, and does not draw it to the screen.
- Note that at most angles, some image information may be lost due to rotation.
See also
- Sphere Surface object