Class CCImage

A CCImage represents an image that can be displayed on screen.

Properties

bimgRepresentation?: [string, string, string][]

The blit image representation of the image, if available.

palette?: number[]

The palette associated with the image, if required.

pixelRepresentation: (undefined | number)[][]

The graphical buffer representation of the image.

size: CCSize

The size of the image in characters.

Methods

  • Create a new CCImage object from a blit image (BIMG) file/data.

    Parameters

    • image: object

      The blit image to load (already unserialized)

    • frame: number = 0

      The 0-indexed frame number to load (defaults to the first frame)

    Returns CCImage

    The newly loaded image

  • Creates a new CCImage object from an NFP file.

    Parameters

    • image: string

      The NFP image data to load

    Returns CCImage

    The newly created image

  • Creates a new CCImage object from a pixel buffer.

    Parameters

    • pixels: (string | number[])[]

      The pixel data to load

    Returns CCImage

    The newly created image