TxSprite constructor

TxSprite({
  1. required int width,
  2. required int height,
  3. required int numColors,
  4. required Uint8List paletteData,
  5. required Uint8List pixelData,
})

Create a sprite with the specified size, palette data and pixel data, identified by the specified message code (the identifier used on the Lua side to label this sprite) width(Uint16), height(Uint16), bpp(Uint8), numColors(Uint8), palette (Uint8 r, Uint8 g, Uint8 b)*numColors, data (length: width x height bytes content: palette index)

Implementation

TxSprite({
  required int width,
  required int height,
  required int numColors,
  required Uint8List paletteData,
  required Uint8List pixelData})
  : _width = width,
    _height = height,
    _numColors = numColors,
    _paletteData = paletteData,
    _pixelData = pixelData;