Version2.0/images

Last-modified: 2009-03-28 (土) 16:20:25
  • Image Image.load(path, destination)
    Create a new image in memory from an image file (PNG, JPG or GIF)
    path (String): path of the image to load
    destination (Number): destination of the image in memory (can be RAM of VRAM)
  • Void Image.destroy(image)
    Desotroy the image
    To completely destroy an image, do :
    myImage:destroy()
    myImage = nil
    image (Image): image to destroy
  • Number Image.width(image)
    Get the width of the image
    image (Image): image to use
  • Number Image.height(image)
    Get the height of the image
    image (Image): image to use
  • Void Image.scale(image, width, height)
    Scale the image
    image (Image): image to scale
    width (Number): new width of the image
    height (Number): new height of the image
  • Void Image.rotate(image, angle [, centerx, centery])
    Rotate the image around rotation center
    image (Image): image to rotate
    angle (Number): angle of roattion (between 0 and 511)
    centerx (Number): x-coordinate of the new rotation center
    centery (Number): y-coordinate of the new rotation center
  • Void Image.rotateDegree(image, angle [, centerx, centery])
    Rotate the image around rotation center, the angle is given in degree
    image (Image): image to rotate
    angle (Number): angle of rotation in degree (between 0 and 360)
    centerx (Number): x-coordinate of the new rotation center
    centery (Number): y-coordinate of the new rotation center
  • Void Image.mirrorH(image)
    Mirror the image horizontally
    image (Image): image to mirror
  • Void Image.mirrorV(image)
    Mirror the image vertically
    image (Image): image to mirror
  • Void Image.setTint(image, color)
    Set the tint of the image
    image (Image): image to tint
    color (Color): color of the image