Skip to content

1681-engine / index / RigView

Class: RigView ​

Defined in: src/rig/RigView.ts:82

A character drawn from a rig pose: give it a pose each frame (setPose, from a PosePlayer) and it places every part. The container's origin is the character's feet (bottom centre of the rig's frame); facing mirrors it.

Extends ​

  • Container

Constructors ​

Constructor ​

ts
new RigView(
   def, 
   skin?, 
   textures?, 
   options?
): RigView;

Defined in: src/rig/RigView.ts:93

Parameters ​

ParameterType
defRigDef
skinRigSkin
textures?TextureRegistry
options?RigViewOptions

Returns ​

RigView

Overrides ​

ts
Container.constructor

Accessors ​

facing ​

Get Signature ​

ts
get facing(): -1 | 1;

Defined in: src/rig/RigView.ts:132

Returns ​

-1 | 1

Set Signature ​

ts
set facing(dir): void;

Defined in: src/rig/RigView.ts:128

1 faces right, -1 faces left.

Parameters ​
ParameterType
dir-1 | 1
Returns ​

void


lastJoints ​

Get Signature ​

ts
get lastJoints(): Joints | null;

Defined in: src/rig/RigView.ts:137

The joints of the last pose, in grid px of the rig's frame (for attaching a held item, an effect).

Returns ​

Joints | null

Methods ​

destroy() ​

ts
destroy(options?): void;

Defined in: src/rig/RigView.ts:156

Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.

Parameters ​

ParameterTypeDescription
options?DestroyOptionsOptions parameter. A boolean will act as if all options have been set to that value

Returns ​

void

Example ​

ts
container.destroy();
container.destroy(true);
container.destroy({ children: true });
container.destroy({ children: true, texture: true, textureSource: true });

Overrides ​

ts
Container.destroy

jointInParent() ​

ts
jointInParent(name): RigPoint | null;

Defined in: src/rig/RigView.ts:142

Where a joint of the last pose is in this view's parent, in world px.

Parameters ​

ParameterType
name| "head" | "elbowF" | "wristF" | "elbowB" | "wristB" | "kneeF" | "ankleF" | "kneeB" | "ankleB" | "chest" | "shoulderF" | "shoulderB" | "hipF" | "hipB"

Returns ​

RigPoint | null


setPose() ​

ts
setPose(pose): this;

Defined in: src/rig/RigView.ts:148

Parameters ​

ParameterType
poseRigPose

Returns ​

this

Released under the MIT License.