Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DragonBones ArmatureDisplay 组件参考 #2323

Closed
wuweikd opened this issue Oct 12, 2022 · 1 comment
Closed

DragonBones ArmatureDisplay 组件参考 #2323

wuweikd opened this issue Oct 12, 2022 · 1 comment

Comments

@wuweikd
Copy link

wuweikd commented Oct 12, 2022

URL : https://github.com/cocos-creator/creator-docs/blob/master/zh/editor/components/dragonbones.md

DragonBones 换肤只能ArmatureDisplay 换吗,只想更换其中一个spriteFrame怎么处理呢,下面的代码ts不支持且报错

   private change() {
        let _armatureDisplay = this.getComponent(dragonBones.ArmatureDisplay)
        const arm = _armatureDisplay.armature()
        let slot = arm.getSlot('2')
        console.log('slot=====', slot)
        let d = arm._skinData.displays
        // @ts-ignore
        let imgData: dragonBones.ImageDisplayData = d['2'][0]
        if (this.testSpriteFrame) {
            console.log('d---->', d)
            console.log('d---->', d['2'])
            console.log('imgData---->', d['2'][0])
            // @ts-ignore
            imgData.texture.spriteFrame = this.testSpriteFrame
            arm.invalidUpdate()
        }
    }
@MrKylinGithub
Copy link
Contributor

这个超出了文档的范畴,建议论坛发贴讨论。谢谢支持!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants