I have already made spine project with animations and have already installed pixi in my web application, but can't use spine.
I have .atlas file, .json file and Sprite image.
This is my code:
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);
}
This causes console error: Cannot read property 'Spine' of undefined
As I understand, I have to add pixi-spine plugin, I couldn't understand how.
I am very beginner, please help
You need to include the Pixi-spine Plugin, available at
https://raw.githubusercontent.com/pixijs/pixi-spine/master/bin/pixi-spine.js
.