Skip to content

快速开始

安装

sh
$ npm i pixi-dragonbones-runtime
sh
$ yarn add pixi-dragonbones-runtime

WARNING

pixi.js@7.x对应pixi-dragonbones-runtime@7.x版本.

使用

ts
import { PixiFactory } from "pixi-dragonbones-runtime";

// 资源加载后
const factory = PixiFactory.factory;

// 资源别名或对象
factory.parseDragonBonesData("xxx_ske.json"); 
factory.parseTextureAtlasData("xxx_tex.json", "xxx_tex.png");

const armatureDisplay = factory.buildArmatureDisplay("xxx");

armatureDisplay.animation.play("xxx",-1);

app.stage.addChild(armatureDisplay);

示例

import "./styles.css";

document.getElementById("app").innerHTML = `
<h1>Hello world</h1>
`;

Released under the MIT License.