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

pixijs getbone无效? #149

Open
a6965921 opened this issue Sep 18, 2020 · 0 comments
Open

pixijs getbone无效? #149

a6965921 opened this issue Sep 18, 2020 · 0 comments

Comments

@a6965921
Copy link

pixijs getbone无效?
` const app = new PIXI.Application({ antialias: true });
document.body.appendChild(app.view);

app.stop();

// load spine data
PIXI.Loader.shared
    .add('skeleton', '/moban/dragonbones/Dragon_ske.json')
    .add('texture_json', '/moban/dragonbones/Dragon_tex.json')
    .add('texture_png', '/moban/dragonbones/Dragon_tex.png')
    .load(onAssetsLoaded);

function onAssetsLoaded(loader, res) {
    const factory = dragonBones.PixiFactory.factory;

    factory.parseDragonBonesData(res.skeleton.data);
    factory.parseTextureAtlasData(res.texture_json.data, res.texture_png.texture);
    var armature = factory.buildArmature("Dragon");
    // var armatureDisplay = armature.getDisplay();
    var armatureDisplay = factory.buildArmatureDisplay('Dragon', 'Dragon');
    armatureDisplay.animation.play('walk');
    armatureDisplay.x = 400.0;
    armatureDisplay.y = 400.0;
    armatureDisplay.scale.x = 0.6;
    armatureDisplay.scale.y = 0.6;
     //调整动画速度
    armatureDisplay.animation.timeScale = 0.1;

    //控制骨骼旋转
    var head =armature.getBone("head");
    head.offset.rotation = 110;

    app.stage.addChild(armatureDisplay);
    // setTimeout(function() {
    //     armatureDisplay.animation.play('stand');
    //     setTimeout(function() {
    //         armatureDisplay.animation.play('walk');
    //     }, 2000)
    // }, 2000)

    app.start();`
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

1 participant