Skip to content

Spine Plugin Cannot create with multiple game instances. #5765

@xiamidaxia

Description

@xiamidaxia

Version

  • Phaser Version: V3.55.2

  • Operating system: Mac

  • Browser: Chrome 91.0.4472.114

Description

I'm developing a game editor that requires just multiple instances of phaser

spine

Example Test Code

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Phaser test</title>
    <script src="http://localhost:8000/build/3.55.2.js"></script>
    <script src="http://localhost:8000/plugins/3.50.x/SpinePluginDebug.js"></script>
</head>
<style>
    canvas {
        display: inline-block;
        margin-right: 20px;
    }
</style>
<body>

</body>
<script>
    const bootScene = {
        preload() {
            this.load.spine('set1', 'http://localhost:8000/assets/spine/3.8/demos/demos.json', [
                'http://localhost:8000/assets/spine/3.8/demos/atlas1.atlas',
                'http://localhost:8000/assets/spine/3.8/demos/atlas2.atlas',
                'http://localhost:8000/assets/spine/3.8/demos/heroes.atlas'
            ], true);
        },
        create() {
            this.add.spine(200, 200, 'set1.alien').setScale(0.5);
        }
    };
    var game1 = new Phaser.Game({
        width: 400,
        height: 400,
        parent: document.body,
        plugins: {
            scene: [
                {
                    key: 'SpinePlugin',
                    plugin: SpinePlugin,
                },
            ]
        },
        scene: [bootScene]
    });
    var game2 = new Phaser.Game({
        width: 400,
        height: 400,
        parent: document.body,
        plugins: {
            scene: [
                {
                    key: 'SpinePlugin',
                    plugin: SpinePlugin,
                },
            ]
        },
        scene: [bootScene]
    });
</script>
</html>

Additional Information

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 SpineAn issue arising from the Spine runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions