mwg API
    Preparing search index...

    Class ChainRig

    The drawing half of a chain: one sprite per segment.

    import { Texture, TextureSource } from 'pixi.js';
    import { ArticulatedChain, ChainRig } from '@datamoc/mwg/two-d/render';

    const skin = new Texture({ source: new TextureSource({ width: 8, height: 8 }) });
    const spine = new ArticulatedChain({ segments: 3, length: 10 });
    const rig = new ChainRig(spine, [skin, skin, skin]); // one Texture per segment
    rig.update(1); // segments sit on the chain's points

    Hierarchy

    • Container
      • ChainRig
    Index