dragonbones.js
TypeScript icon, indicating that this package has built-in type declarations

5.7.4 • Public • Published

dragonBones

npm version npm downloads

官方库 需要几处改动才能用得顺手,所以有了这个修改版。

Install

npm i dragonbones.js

Usage

const
  factory = dragonBones.PixiFactory.factory,
  {resources} = loader

factory.parseDragonBonesData(resources['orad_ske.json'].data)
factory.parseTextureAtlasData(
  resources['orad_tex.json'].data,
  resources['orad_tex.png'].texture
)

const anime = factory.buildArmatureDisplay('root')
// 事件帧
anime.armature.eventDispatcher.addDBEventListener('frameEvent', async ({name}) => {
  if (name !== 'meet:end') return
  anime.animation.play('love')
  await delay(3)
  anime.animation.play('snatch')
})
anime.animation.play('meet')
anime.position.set(screen.width >> 1, screen.height + 200 >> 1)
stage.addChild(anime)

Readme

Keywords

Package Sidebar

Install

npm i dragonbones.js

Weekly Downloads

34

Version

5.7.4

License

MIT

Unpacked Size

1 MB

Total Files

4

Last publish

Collaborators

  • jetlua