Skip to content

Palette API

Syntax Sculptor edited this page Oct 17, 2026 · 2 revisions

Palette

Methods

Palette:Init(mod)

Initializes Palette and registers multiple callbacks to handle the management of Particle Emitters.

This method should only be called once in your main.lua. Sbusequent calls will result in an error.

Parameters

Parameter Type Description
mod ModReference

Returns: nil

Example

local MyMod = RegisterMod("Palette Test", 1)
local Palette = include("mod-scripts.palette")
MyMod.Palette = Palette

Palette:Init(MyMod)

Palette:CreateParticleEmitter(texturePath, position)

Creates and returns a new Particle Emitter.

The provided texturePath must be a 32-bit PNG file. If an invalid texturePath is provided, an error will be thrown.

Parameters

Parameter Type Description
texturePath string The path to the particle's texture. All particles emmitted will use it.
position Vector | Vector3 (optional) The Particle Emitter's position. Default: (0, 0, 0)

Returns: Particle Emitter

Palette.Vector3(x, y, z)

Warning

This function must be called using a . instead of a :.

Constructs a new Vector3 object.

Parameters

Parameter Type Description
x number The X coordinate. Default: 0
y number The Y component. Default: 0
z number The Z component. Default: 0

Returns: Vector3


Clone this wiki locally