FxPixel โ
This module contains functions for making and editing FoxelPixel values.
Load โ
FxPixel = require "FxPixel";Functions โ
| Function | Description |
|---|---|
| Create (Color, Material) | Creates a pixel. |
| GetHeight (Pixel) | Returns the height of a pixel. |
| GetColor (Pixel) | Returns the color of a pixel. |
| GetMaterial (Pixel) | Returns the material of a pixel. |
| SetHeight (Pixel, Value) | Sets the height of a pixel. |
| SetColor (Pixel, Value) | Sets the color of a pixel. |
| SetMaterial (Pixel, Value) | Sets the material of a pixel. |
Create (Color, Material) โ
This function creates a pixel from the given color and material ItemIndex.
Parameters โ
Returns โ
The created FoxelPixel
Errors โ
Possible errors include FX_ITEM_INDEX_INVALID
Since โ
Version 1.0
Example โ
pixel = FxPixel.Create(10, 0);GetHeight (Pixel) โ
This function returns the height of the given pixel.
Parameters โ
- Pixel: The FoxelPixel to query
Returns โ
The height
Errors โ
Possible errors include FX_VALUE_INVALID
Since โ
Version 1.0
Example โ
height = FxPixel.GetHeight(pixel);GetColor (Pixel) โ
This function returns the color ItemIndex of the given pixel. This index can be used for example with FxColorPalette to get the color properties.
Parameters โ
- Pixel: The FoxelPixel to query
Returns โ
The color ItemIndex
Errors โ
Possible errors include FX_VALUE_INVALID
Since โ
Version 1.0
Example โ
colorid = FxPixel.GetColor(pixel);
color = FxColorPalette.GetItemColor(colorid);GetMaterial (Pixel) โ
This function returns the material ItemIndex of the given pixel. This index can be used for example with FxMaterialSet to get the material properties.
Parameters โ
- Pixel: The FoxelPixel to query
Returns โ
The material ItemIndex
Errors โ
Possible errors include FX_VALUE_INVALID
Since โ
Version 1.0
Example โ
material = FxPixel.GetMaterial(pixel);
metallic = FxMaterialMap.GetItemMetallic(material);SetHeight (Pixel, Value) โ
This function changes the height of the given pixel and returns the updated pixel.
Parameters โ
- Pixel: The FoxelPixel
- Value: New height value
Returns โ
The updated FoxelPixel
Errors โ
Possible errors include FX_VALUE_INVALID
Since โ
Version 1.0
Example โ
pixel = FxPixel.SetHeight(pixel, 100);SetColor (Pixel, Value) โ
This function changes the color of the given pixel and returns the updated pixel.
Parameters โ
- Pixel: The FoxelPixel
- Value: The new color ItemIndex
Returns โ
The updated FoxelPixel
Errors โ
Possible errors include FX_VALUE_INVALID, FX_ITEM_INDEX_INVALID
Since โ
Version 1.0
Example โ
pixel = FxPixel.SetColor(pixel, 100);SetMaterial (Pixel, Value) โ
This function changes the material of the given pixel and returns the updated pixel.
Parameters โ
- Pixel: The FoxelPixel
- Value: The new material ItemIndex
Returns โ
The updated FoxelPixel
Errors โ
Possible errors include FX_VALUE_INVALID, FX_ITEM_INDEX_INVALID
Since โ
Version 1.0
Example โ
pixel = FxPixel.SetMaterial(pixel, 2);