Skip to content

FxPixelCapsule ​

This module provides functions to work with nodes inheriting from PixelCapsule, which are nodes of type PixelReference.

Load ​

lua
FxPixelCapsule = require "FxPixelCapsule";

Functions ​

FunctionDescription
Convert (NodeID)Converts a pixel capsule to a pixel layer node.
Flip (NodeID, Horizontally)Flips the pixel grid of a pixel capsule.
Rotate90 (NodeID, Steps)Rotates the pixel grid of a a pixel capsule in 90° steps.

Convert (NodeID) ​

This function converts the specified PixelCapsule node to a PixelLayer node.

Parameters ​

  • NodeID: The NodeID to identify the PixelCapsule nodes to convert

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- convert "Reference1" to a PixelLayer
FxPixelCapsule.Convert("Reference1");

Flip (NodeID, Horizontally) ​

This function flips the pixel grid of the specified PixelCapsule node.

Parameters ​

  • NodeID: The NodeID to identify the PixelCapsule nodes to flip
  • Horizontally: Whether to flip horizontally

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- flip horizontally
FxPixelCapsule.Flip("Reference1", true);

Rotate90 (NodeID, Steps) ​

This function rotates the pixel grid of the specified PixelCapsule in 90° steps.

Parameters ​

  • NodeID: The NodeID to identify the PixelCapsule nodes to rotate
  • Steps: The number of 90° rotation steps

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- rotate 90° counter clockwise
FxPixelCapsule.Rotate90("Reference1", -1);