# Acnl

A class representing an Animal Crossing New Leaf in-game pattern.

# Constructor

Instantiates an Acnl.

  • Arguments
    • acnl
      • Type: Acnl

# Instance Accessors

# title

The title of the Acnl.

  • get
    • Type: string
    • Default: ""
  • set
    • Type: string
    • Note: limited to 20 characters

# villagerId

The id of the villager. Needs to be equal to in-game villagerId for pattern to be editable.

  • get
    • Type: number
    • Default: 0
  • set
    • Type: number
    • Note: limited to unsigned 16 bit values

# villagerName

The name of the villager.

  • get
    • Type: string
    • Default: ""
  • set
    • Type: string
    • Note: limited to 8 characters

# villagerIsFemale

The gender flag of the villager.

  • get
    • Type: boolean
    • Default: false
  • set
    • Type: boolean

# townId

The id of the town. Needs to be equal to in-game townId for pattern to be editable.

  • get
    • Type: number
    • Default: 0
  • set
    • Type: number
    • Note: limited to unsigned 16 bit values

# townName

The name of the town.

  • get
    • Type: string
    • Default: ""
  • set
    • Type: string
    • Note: limited to 8 characters

# type

The type of the pattern (e.g. Standard, Shirt, Dress, etc.)

  • get
    • Type: PatternType
    • Default: Acnl.types.Standard
  • set
    • Type: PatternType

# palette

A mapping for rendering colors.

  • get
    • Type: Array<color>
    • Default: new Array<color>(15).fill("#FFFFFF") .
  • set

# pixels

The arrangement of the pixels as a pixel grid, includes unused pixels.

# sections

The different possible access mappings of the pattern.

# hooks

The hook system for subscribing to and triggering events.

# Instance Methods

# toBinaryString

Creates a formatted binary string from an Acnl.

  • Returns
    • Type: string

# fromBinaryString

Loads data into the Acnl from a formatted binary string.

  • Arguments
    • binaryStringrequired
      • Type: string
  • Returns

# toQRCodes

Creates QR Code images for the Acnl.

It creates the most minimal qr code images possible. If you need to scale up the image to create downloads for it, use a canvas and make sure to do context.imageSmoothingEnabled=false;

If you plan on scaling it for display via CSS, use image-rendering: pixelated to tell the browser to keep the sharpness of the original image.

  • Returns
    • Type: Promise<Array<HTMLImageElement>>

# fromQRCodes

Decodes 1 whole or 4 multipart QR codes to construct an Acnl from the images. If there are multiple Acnls encoded in the images, loads the first it can decode.

  • Arguments
    • images
      • Type: Array<HTMLImageElement>
  • Returns

# Static Properties

# types

The pattern type this format instance is using e.g. Standard, Shirt, Hat, etc.

# colors

The set of colors in the Acnl colorspace.

# colorToByte

The color to byte mappings, used to convert colors to byte values.

# byteToColor

The byte to color mappings, used to convert bytes to colors.

# Static Methods

# nearestColorInColorSpace

Translates the inputColor to the closest available hex color in the space.

  • Arguments
    • colorrequired
  • Returns

# toBinaryString

Creates a formatted binary string from an Acnl.

  • Arguments
    • acnlrequired
  • Returns
    • Type: string

# fromBinaryString

Creates an Acnl from a formatted binary string.

  • Arguments
    • binaryStringrequired
      • Type: string
  • Returns

# toQRCodes

Creates QR Code images for the Acnl.

  • Arguments
    • acnlrequired
  • Returns
    • Type: Promise<Array<HTMLImageElement>>

# fromQRCodes

Constructs an acnl from QR Codes.

  • Arguments
    • imagesrequired
      • Type: Array<HTMLImageElement>
  • Returns

# readQRCodes

Decodes QR Codes to construct Acnls from the QR Codes in the images.

The image must be sufficiently sharp enough to read the QR codes. Compressed image formats (like jpeg) are more likely to fail because they introduce noise.

  • Arguments
    • imagesrequired
      • Type: Array<HTMLImageElement>
  • Returns
    • Type: Promise<Array<Acnl>>
Last Updated: 11/30/2020, 9:31:43 PM