Skip to content

FxMiniSet โ€‹

This module contains functions for editing the items of a Mini Set. Each Mini Set has 256 items - or Minis - which can be refered to by an ItemIndex. All functions of this module work on the open Mini Set. To open a Mini Set use FxFile.Open. A Mini can only be edited if it is available. To make a new Mini available use CreateItem. To save the changes made after editing the open Mini Set use FxFile.Save.

Load โ€‹

lua
FxMiniSet = require "FxMiniSet";

Functions โ€‹

FunctionDescription
Clear ()Clears all Minis.
CreateItem ()Creates a new Mini.
DeleteItem (ItemIndex)Deletes a Mini.
GetItemPixel (ItemIndex, X, Y)Returns the pixel of a Mini.
GetItemName (ItemIndex)Returns the name of a Mini.
SetItemPixel (ItemIndex, X, Y, Value)Sets the pixel of a Mini.
SetItemName (ItemIndex, Value)Sets the name of a Mini.

Clear () โ€‹

This function deletes all Minis from the open Mini Set.

Errors โ€‹

Possible errors include FX_REQUIRED_FILE_UNAVAILABLE

Since โ€‹

Version 1.0

Example โ€‹

lua
FxMiniSet.Clear();

CreateItem () โ€‹

This function creates a Mini, adds it to the opened Mini Set, initializes it with default values and returns its index.

Returns โ€‹

The ItemIndex of the new Mini.

Errors โ€‹

Possible errors include FX_REQUIRED_FILE_UNAVAILABLE, FX_FILE_OPERATION_FAILED

Since โ€‹

Version 1.0

Example โ€‹

lua
itemindex = FxMiniSet.Create();

DeleteItem (ItemIndex) โ€‹

This function deletes the specified Mini, making it unavailable.

Parameters โ€‹

  • ItemIndex: The ItemIndex of the Mini to be deleted

Errors โ€‹

Possible errors include FX_REQUIRED_FILE_UNAVAILABLE, FX_ITEM_INDEX_INVALID, FX_ITEM_UNAVAILABLE

Since โ€‹

Version 1.0

Example โ€‹

lua
FxMiniSet.DeleteItem(20);

GetItemName (ItemIndex) โ€‹

This function returns the name of the specified Mini.

Parameters โ€‹

  • ItemIndex: The ItemIndex of the Mini to query

Returns โ€‹

Name

Errors โ€‹

Possible errors include FX_REQUIRED_FILE_UNAVAILABLE, FX_ITEM_INDEX_INVALID, FX_ITEM_UNAVAILABLE

Since โ€‹

Version 1.0

Example โ€‹

lua
name = FxMiniSet.GetItemName(2);

GetItemPixel (ItemIndex, X, Y) โ€‹

This function returns the pixel of the specified Mini at given coordinates.

Parameters โ€‹

  • ItemIndex: The ItemIndex of the Mini
  • X: The X coordinate
  • Y: The Y coordinate

Returns โ€‹

FoxelPixel

Errors โ€‹

Possible errors include FX_REQUIRED_FILE_UNAVAILABLE, FX_ITEM_INDEX_INVALID, FX_ITEM_UNAVAILABLE

Since โ€‹

Version 1.0

Example โ€‹

lua
pixel = FxMiniSet.GetItemPixel(2, 5, 5);

SetItemName (ItemIndex, Value) โ€‹

This function sets the name of the specified Mini.

Parameters โ€‹

  • ItemIndex: The ItemIndex of the Mini
  • Value: The new name

Errors โ€‹

Possible errors include FX_REQUIRED_FILE_UNAVAILABLE, FX_ITEM_INDEX_INVALID, FX_ITEM_UNAVAILABLE

Since โ€‹

Version 1.0

Example โ€‹

lua
FxMiniSet.SetItemName(10, "wall");

SetItemPixel (ItemIndex, X, Y, Value) โ€‹

This function sets the pixel of the specified Mini at given coordinates.

Parameters โ€‹

  • ItemIndex: The ItemIndex of the Mini
  • X: The X coordinate
  • Y: The Y coordinate
  • Value: The new FoxelPixel

Errors โ€‹

Possible errors include FX_REQUIRED_FILE_UNAVAILABLE, FX_ITEM_INDEX_INVALID, FX_ITEM_UNAVAILABLE, FX_VALUE_INVALID

Since โ€‹

Version 1.0

Example โ€‹

lua
pixel = FxPixel.Create(0, 0);
FxMiniSet.SetItemPixel(10, 5, 5, pixel);