How to use pixi-spine - 4 common examples

To help you get started, we’ve selected a few pixi-spine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 36base / 36base.github.io / src / repositories / SpineRepository.js View on Github external
exts.forEach((ext) => {
      const { error } = resource[getName(ext)];
      if (error) {
        throw error.message;
      }
    });

    const rawSkel = getSkelJson(resource[getName('skel')].data);
    const rawAtlas = resource[getName('atlas')].data;
    const rawPng = resource[getName('png')].data;

    const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
      callback(new PIXI.BaseTexture(rawPng));
    });
    const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
    const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);

    cache[dollCode][type][skinCode] = spineJsonParser.readSkeletonData(rawSkel);
  }

  return cache[dollCode][type][skinCode];
}
github 36base / 36base.github.io / src / utils / spine / SpineLoader.js View on Github external
);
  });

  const resources = await new Promise(resolve => loader.load((_, res) => resolve(res)));
  Object.values(resources).forEach((resource) => {
    const { error } = resource;
    if (error) {
      throw new Error(error.message);
    }
  });

  const rawSkel = getSkelJson(resources[getName('skel')].data);
  const rawAtlas = resources[getName('atlas')].data;
  const rawPng = resources[getName('png')].data;

  const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
    callback(new PIXI.BaseTexture(rawPng));
  });
  const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
  const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);

  return spineJsonParser.readSkeletonData(rawSkel);
}
github 36base / 36base.github.io / src / repositories / SpineRepository.js View on Github external
resource = await new Promise(resolve => loader.load((_, res) => resolve(res)));
    }
    loader.destroy(true);

    exts.forEach((ext) => {
      const { error } = resource[getName(ext)];
      if (error) {
        throw error.message;
      }
    });

    const rawSkel = getSkelJson(resource[getName('skel')].data);
    const rawAtlas = resource[getName('atlas')].data;
    const rawPng = resource[getName('png')].data;

    const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
      callback(new PIXI.BaseTexture(rawPng));
    });
    const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
    const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);

    cache[dollCode][type][skinCode] = spineJsonParser.readSkeletonData(rawSkel);
  }

  return cache[dollCode][type][skinCode];
}
github 36base / 36base.github.io / src / utils / spine / SpineLoader.js View on Github external
const resources = await new Promise(resolve => loader.load((_, res) => resolve(res)));
  Object.values(resources).forEach((resource) => {
    const { error } = resource;
    if (error) {
      throw new Error(error.message);
    }
  });

  const rawSkel = getSkelJson(resources[getName('skel')].data);
  const rawAtlas = resources[getName('atlas')].data;
  const rawPng = resources[getName('png')].data;

  const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
    callback(new PIXI.BaseTexture(rawPng));
  });
  const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
  const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);

  return spineJsonParser.readSkeletonData(rawSkel);
}

pixi-spine

Pixi integration with EsotericSoftware Spine, big, contains all runtimes

SEE SPINE-LICENSE
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis

Popular pixi-spine functions