Legacy:Image

From Spherical
Revision as of 05:16, 4 June 2013 by Apollolux (talk | contribs) (Initializers: GetTileImage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Image object holds an image in memory to be used for drawing.

Initializers

  • 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.
  • GetTileImage(tile): Get the Image of tile in the current map tileset.
  • Surface.createImage(): Create a new Surface using the picture data in the image.

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.

Methods

  • Image.clone(): returns a copy of an existing image object
  • 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.
  • Image.createSurface(): Create a new Surface using the picture data in the image.

Members

  • width The width of the image, in pixels.
  • height The height of the image, in pixels.

Notes

Operations cannot be performed on an Image object, so if you need to change the image you should use a Surface instead.

See also


API:Image/navbox