new Stage(): Stageconstructor | Made once, by the scene as it starts: don't make one yourself. |
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[] }): Mmethod | Makes a mote of a class. |
destroy(mote: Mote): voidmethod | Takes a mote out of the scene. |
find<M extends Mote>(cls: string | () => M): M | nullmethod | The first mote of a class. |
findAll<M extends Mote>(cls: string | () => M): M[]method | Every mote of a class (its subclasses' too). |
withTag(tag: string): Mote[]method | Every mote with a tag. |
byId(id: string): Mote | nullmethod | A mote by its id. |
byName(name: string): Mote | nullmethod | A mote by its name. |
randomPointInView(): Vector3method | A random point on the scene, its pixels. |
castRay(from: Place, to: Place, options?: { world?: "2d" | "3d" }): Promise<MotionRayHit | null>method | The first mote's body a ray from one point to another meets, next turn. |
setGravity(v: Place, world?: "2d" | "3d"): voidmethod | Sets a world's gravity. |
join(a: string | Mote, b: string | Mote, joint?: MotionJointSpec): numbermethod | Joins two motes' bodies. |
unjoin(id: number): voidmethod | Lets a joint go. |
onStart(): voidmethod | It started. |
onTick(dt: number): voidmethod | Each tick. |
onSettingsChanged(props: Record<string, any>): voidmethod | The wallpaper's settings changed. |