Skip to content
firstmiddlelast edited this page Aug 26, 2023 · 1 revision
  • width, read-only. The width of the image.

  • height, read-only. The height of the image.

  • stride, read-only. The number of bytes per image row.

  • format, read-only. The PixelFormat of the image.

  • getPixel (x, y), reads a color from the given coordinate of the image.

    • Argument: x integer
    • Argument: y integer
    • Returns: a color value
  • putPixel (x, y, color), writes the color onto the image at the the given coordinate.

    • Argument: x integer
    • Argument: y integer
    • Argument: color a 32-bit color in 8888 RGBA format.
  • clear (color), clears the image with the specified color.

    • Argument: color a 32-bit color in 8888 RGBA format.
  • putImageData (data), writes the given pixels onto the image. Must be the same size as the image.

    • Argument: data All of the pixels in the image.
  • getImageData (), creates an array containing all of the image's pixels.

    • Returns: All pixels in an array (Lua) or a Uint8Array (JS)

Clone this wiki locally