Options
All
  • Public
  • Public/Protected
  • All
Menu

A Spawn behavior that places (and optionally rotates) particles according to a specified shape. Additional shapes can be registered with SpawnShape.registerShape(). Additional shapes must implement the SpawnShape interface, and their class must match the SpawnShapeClass interface. Shapes included by default are:

Example config:

{
type: 'spawnShape',
config: {
type: 'rect',
data: {
x: 0,
y: 0,
width: 20,
height: 300,
}
}
}

Hierarchy

  • ShapeSpawnBehavior

Implements

Index

Constructors

Properties

order: BehaviorOrder = BehaviorOrder.Spawn

Order in which the behavior will be handled. Lower numbers are handled earlier, with an order of 0 getting special treatment before the Emitter's transformation is applied.

shape: SpawnShape
editorConfig: BehaviorEditorConfig = null
shapes: {} = {}

Dictionary of all registered shape classes.

Type declaration

type: string = 'spawnShape'

Methods

  • Registers a shape to be used by the ShapeSpawn behavior.

    Parameters

    • constructor: SpawnShapeClass

      The shape class constructor to use, with a static type property to reference it by.

    • Optional typeOverride: string

      An optional type override, primarily for registering a shape under multiple names.

    Returns void

Generated using TypeDoc