【问题标题】:Can't use spine for pixi.js无法将脊椎用于 pixi.js
【发布时间】:2017-03-06 00:46:50
【问题描述】:

我已经制作了带有动画的spine项目,并且已经在我的网络应用程序中安装了pixi,但是不能使用spine。

我有 .atlas 文件、.json 文件和 Sprite 图像。

这是我的代码:

var renderer = PIXI.autoDetectRenderer(800, 600);
jQuery("body").prepend(renderer.view);

// create the root of the scene graph
var stage = new PIXI.Container();

// load spine data
PIXI.loader
    .add('boy', 'assets/data/boy.json')
    .load(onAssetsLoaded);

var boy = null;

function onAssetsLoaded(loader,res)
{
    // instantiate the spine animation
    boy = new PIXI.spine.Spine(res.boy.spineData);
}

这会导致控制台错误:无法读取未定义的属性“Spine”

据我所知,我必须添加 pixi-spine 插件,我不明白如何。

我是初学者,请帮忙

【问题讨论】:

    标签: javascript pixi.js spine


    【解决方案1】:

    您的 HTML 中是否添加了 pixi-spine.min.js,就像您添加了 pixi.min.js 一样?

    【讨论】:

      【解决方案2】:

      您需要包含 Pixi-spine 插件,可在 https://raw.githubusercontent.com/pixijs/pixi-spine/master/bin/pixi-spine.js.

      【讨论】:

        猜你喜欢
        • 2015-08-12
        • 2018-03-11
        • 2021-01-18
        • 2014-04-10
        • 2011-03-27
        • 1970-01-01
        • 1970-01-01
        • 2012-04-22
        • 1970-01-01
        相关资源
        最近更新 更多