0

我尝试使用以下代码添加插件

    import { Tween, Ease } from '@createjs/tweenjs';
    import MotionGuidePlugin from '@createjs/tweenjs/src/plugins/MotionGuidePlugin';


    const tween = Tween.get(this.mySprite, { override: true, pluginData: 'MotionGuide' })

它无法正常工作。

4

1 回答 1

0

我没有看到您的运动指南数据。你查看过 GitHub 中的演示吗?

确保安装一次插件

createjs.MotionGuidePlugin.install(createjs.Tween);

然后将运动引导数据传递到补间:

createjs.Tween.get(ball, {bounce: true, loop:3})
    .to({guide: {path: [100,100, 700,100, 800,250], orient: "fixed"}}, 2000);

下面是一些关于 CodePen 的演示:

如果您有具体问题,或者您可以链接到演示,请更新您的问题,我可以尝试回答。

于 2018-12-17T16:24:44.083 回答