Difference between revisions of "Legacy:Functions/Images"

From Spherical
Jump to: navigation, search
(created)
 
(No difference)

Latest revision as of 17:34, 22 May 2013

Images

  • Sphere Image object: Holds a 2D bitmap for displaying.
  • LoadImage(filename): Load an image from filename.
  • GrabImage(x, y, width, height): Grab the screen contents at (x, y, width, height) and store it in a new Image object.

System images

  • GetSystemArrow(): Get the right-pointing arrow image that comes with the Sphere engine.
  • GetSystemUpArrow(): Get the up-pointing arrow image that comes with the Sphere engine.
  • GetSystemDownArrow(): Get the down-pointing arrow image that comes with the Sphere engine.

Image object

Blitting (drawing) images

  • Image.blit(x, y): Draw the image with the top-left corner at (x, y).
  • Image.blitMask(x, y, mask): Draw the image at (x, y) with mask as the tinting color.
  • Image.rotateBlit(center_x, center_y, angle): Draw the image centered at (center_x, center_y), rotated by angle radians.
  • Image.rotateBlitMask(center_x, center_y, angle, mask): rotateBlit + mask.
  • Image.zoomBlit(x, y, factor): Draw the image zoomed by factor with the top-left corner at (x, y).
  • Image.zoomBlitMask(x, y, factor, mask): zoomBlit + mask.
  • Image.transformBlit(x1, y1, x2, y2, x3, y3, x4, y4): Draw the image with top-left (x1, y1), top-right (x2, y2), bottom-right (x3, y3) and bottom-left (x4, y4).
  • Image.transformBlitMask(x1, y1, x2, y2, x3, y3, x4, y4, mask): Draw the image stretched to fit 4 coordinates clockwise from the top-left, with a masking color.

Surface conversion