dragonbones-pixijs
Version:
DragonBones runtime for pixi v8
137 lines (105 loc) ⢠3.61 kB
Markdown
DragonBones runtime and Demo for Pixi V8.
[](https://egret.com) the company behind DragonBones seems have abandoned DragonBones and its libraries from years ago...
But... there is Hope!
[](https://sggame.us) Our team will upgrade it to support modern Js/Ts runtime and adding a new shiny Editor too.
š„š„š„ Stay tuned! š„š„š„
Same as DragonBones.js at the moment:
- ā
Modern typescript
- ā
Pixi V8 with much better performance
- ā
Animations
- ā
Mesh
- ā
IK
- ā
Events
- ā
Userdata
but soon with more next-gen features:
- š„ AI Generated images and characters with animation
- š„ 2D/3D motion matching
- š„ Export to Threejs
- š„ Export to Babalonjs
- š„ Export to Unity
- š„ Export to Godot
- š„ Export to Unreal
- š„ Anigo the 2D editor
- š„ Blender plugin
https://www.npmjs.com/package/dragonbones-pixijs
```
npm install dragonbones-pixijs
```
```typescript
export default class HelloDragonBones extends BaseDemo {
public constructor() {
super();
this._resources.push(
"resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json",
"resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json",
"resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png"
);
}
protected _onStart(): void {
const factory = PixiFactory.factory;
factory.parseDragonBonesData(this._pixiResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json"]);
factory.parseTextureAtlasData(
this._pixiResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json"],
this._pixiResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png"]);
const armatureDisplay = factory.buildArmatureDisplay("mecha_1002_101d", "mecha_1002_101d_show")!;
armatureDisplay.animation.play("idle");
this.container.addChild(armatureDisplay);
}
}
```
From Pixi V8, Loader is gone, use await Assets.load instead.
```
await Assets.load()
```
```typescript
const factory = PixiFactory.factory;
factory.parseDragonBonesData(this._pixiResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json"]);
factory.parseTextureAtlasData(
this._pixiResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json"],
this._pixiResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png"]);
```
From Pixi v8,
- DisplayObject is gone, replaced with Container.
- Only Container can have children
```typescript
const armatureDisplay = factory.buildArmatureDisplay("mecha_1002_101d", "mecha_1002_101d_show")!;
armatureDisplay.animation.play("idle");
this.container.addChild(armatureDisplay);
```
Work with Vite
```
npm install
npm run dev
```
```
npm run build
```
[](https://sggames.github.io/DragonBones-Pixi/)
- Click button in the top to go through different Examples


- CodeSandBox.io samples (WIP)
## References
Old version (PixiV4-5)
https://github.com/DragonBones/DragonBonesJS
Pixi.js
- https://pixijs.com/
- https://github.com/pixijs/pixijs
- https://pixijs.com/8.x/guides/migrations/v8 (How to migrate from old version)
## License
MIT License
- Same as DragonBones.js
- Same as Pixi.js
## Contributions
- Credit to SGGames.us
- Main contributor: @atomixnmc