Adding WebGL Spine plugin to scenes


#1

Hello all,
I am having a bit of difficulty adding the Spine plugin to my game. I am currently using ES6 and my “main.js” looks like the following:

import Utils from './library/Utils.js';
import Preloader from './scenes/preloader/Preloader.js';
import Boot from './scenes/boot/Boot.js';
import Game from './scenes/game/Game.js';
import Intro from './scenes/intro/Intro.js';

class Main
{
    constructor()
    {
        let config = {
            type: Phaser.WEBGL,
            width: 1024,
            height: 768,
			scale: {
                mode: Phaser.Scale.FIT,
                autoCenter: Phaser.Scale.CENTER_VERTICALLY
            },
            scene: [
                Boot,
                Intro,
                Preloader,
                Game
            ]
        };

        this.game = new Phaser.Game(config);
        this.game.isMuted = false;

        Utils.Initialize(this.game);
    }
}
new Main();

This above syntax’s config has a “scene” property, which is an array of all of my scenes. In order to add the Spine plugin, the “scene” property needs to be a plugin object. Unfortunately, I don’t know how to have both… any help is greatly appreciated.


#2

I have posted an Spine example in post #1042 and my platformer example also uses spine animations (in post #919).

Hope this helps :slight_smile: