Motion
Get Motion

ReferenceScripting APIJointComponent

JointComponent

class

Joins its mote's body to another's (stage.join), from connect() until disconnect().

NameJointComponent
Kindclass
Script reaches it asimport { JointComponent } from "motion"
Since0.4

Syntax

class JointComponent extends Component { … }

Properties

NameTypeDescription
namepropertyreadonly stringIts name on its mote.
layerpropertyreadonly stringIts layer's id.
visiblepropertybooleanWhether its layer shows.
opacitypropertynumberIts layer's opacity, 0 to 1.
otherpropertyMote | nullThe other mote.
jointpropertyMotionJointSpecHow they're joined.
idpropertyreadonly numberThe joint's number (0 while not joined).

Methods

SignatureDescription
set(key: string, value: SettingValue): voidmethodChanges one of its layer's settings.
animate(key: string, value: string | number, seconds: number, options?: MotionAnimateOptions): Promise<boolean>methodMoves one of its layer's settings.
stopAnimating(key?: string): voidmethodStops its layer's moves.
get(key: string): SettingValue | undefinedmethodOne of its layer's settings, as scene.get.
read(key: string): SettingValue | undefinedmethodOne of its layer's settings as last drawn, as scene.read.
show(visible?: boolean): voidmethodShows (or hides) its layer.
hide(): voidmethodHides its layer.
new JointComponent(name: string, mote: Mote, other: Mote, joint?: MotionJointSpec): JointComponentconstructorJoins two motes' bodies.
connect(): numbermethodJoins them now.
disconnect(): voidmethodLets them go.

See also

SettingValue · Mote · MotionJointSpec