defineMask
defineMask<
O>(spec):MaskDefinition<O>
Defined in: renderer/src/masks/defineMask.ts:46
Register a mask preset under a stable string name so masks attached
through it survive save/load. The returned callable accepts the mask’s
options and yields a MaskFactory whose built Mask is tagged with
{ name, options } for serialization.
spriteMask and graphicsMask intentionally do not register: a saved
Sprite reference or draw closure has no string identity, so the saved
snapshot cannot rebuild them.
Type Parameters
Section titled “Type Parameters”O
Parameters
Section titled “Parameters”factory
Section titled “factory”(options) => Mask
string