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);