Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit95280a384c

README.md

Particles.spec

How the particle system reads an emitter spec. Each reader checks one field against the shapes it takes and raises a refusal naming the field and those shapes; level is how far out the refusal is reported, counted from the reader, so it lands on the call that wrote the value.

  • readRange(value, field, lo, hi, level) reads a number or {min, max}, and rangeArgs(min, max) packs the two arguments a range setter takes.
  • readSize(value, fallbackSeq, level) reads a number, {min, max}, a NumberSequence or a keypoint list.
  • asNumberSequence(value, fallback, field, level) and asColorSequence(value, fallback) read a curve.
  • readBursts(bursts) normalizes a burst schedule; readDirection(dir) a direction.
  • readNumber, readBoolean, readEnum, readVector and readTable read one value of their kind, and nameSet(names) builds the set readEnum checks against.
local Spec = require("@builtin::deprecated.deprecatedParticles.engine.spec")
local lo, hi = Spec.readRange({ 1, 3 }, "lifetime", 1, 1, 2)
print(lo, hi) -- 1 3