ReferenceScripting APIStagespawn
Stage.spawn
methodMakes a mote of a class.
| Name | spawn |
|---|---|
| Kind | method of Stage |
| Called as | stage.spawn(…) |
| As a node | Spawn Mote (logic graph) |
| Since | 0.3 |
Syntax
spawn<M extends Mote>( cls: string | () => M, options?: { location?: Place; rotation?: number | number[] | Rotator; scale?: number | Place; name?: string; properties?: Record<string, unknown>; tags?: string[] }): MParameters
| Name | Type | Description |
|---|---|---|
cls | string | () => M | The class, or its name |
options | { location?: Place; rotation?: number | number[] | Rotator; scale?: number | Place; name?: string; properties?: Record<string, unknown>; tags?: string[] } | Optional. Its location, rotation, scale, name, properties and tags |
Returns
M: the mote.
Remarks
Throws for a class there's none of, and past 8192 motes.
See also
Rotator · In examples: Constellations, Vent Garden
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.