cc.image.nft

Provides utilities for working with "nft" images.

nft ("Nitrogen Fingers Text") is a file format for drawing basic images. Unlike the images that paintutils.parseImage uses, nft supports coloured text.

Usage

parse(image)Parse an nft image from a string.
load(path)Load an nft image from a file.
draw(image, xPos, xPos[, target])Draw an nft image to the screen.
parse(image)Source

Parse an nft image from a string.

Parameters

  1. image string The image contents.

Returns

  1. table The parsed image.
load(path)Source

Load an nft image from a file.

Parameters

  1. path string The file to load.

Returns

  1. table The parsed image.

Or

  1. nil If the file does not exist or could not be loaded.
  2. string An error message explaining why the file could not be loaded.
draw(image, xPos, xPos[, target])Source

Draw an nft image to the screen.

Parameters

  1. image table An image, as returned from load or draw.
  2. xPos number The x position to start drawing at.
  3. xPos number The y position to start drawing at.
  4. target? term.Redirect The terminal redirect to draw to. Defaults to the current terminal.