Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange Error With Using Spine #30

Closed
MarkSky opened this issue Mar 10, 2021 · 4 comments
Closed

Strange Error With Using Spine #30

MarkSky opened this issue Mar 10, 2021 · 4 comments

Comments

@MarkSky
Copy link

MarkSky commented Mar 10, 2021

Phaser: 3.53.1
Spine: 3.8.95
@ion-phaser/core: 1.2.3

If I used the Spine in Phaser, I will get the error:

Uncaught TypeError: renderer.pipelines.clear is not a function
at SpineGameObjectWebGLRenderer [as renderWebGL] (SpinePlugin.js:35723)

But with out @ion-phaser/core, it's fine.
How could I solved it?
Thanks.

@jdnichollsc
Copy link
Member

Can you share a code example please?

@jdnichollsc
Copy link
Member

Please try the last version and let me know, thanks!

@MarkSky
Copy link
Author

MarkSky commented Mar 16, 2021

These is my code:
in GameTest.vue

<template>
    <div class="game-test-box">
        <ion-phaser
            :game.prop="game"
            :initialize.prop="initialize"
            class="mine-box" />
    </div>
</template>

<script>
    import Phaser from 'phaser';
    import 'phaser/plugins/spine/dist/SpinePlugin';
    import SymbolScene from '@/scripts/scene/SymbolScene';

    export default {
        data() {
            return {
                initialize: false,

                game: {
                    width: 664,
                    height: 1152,
                    transparent: true,
                    type: Phaser.AUTO,
                    plugins: {
                        scene: [{ key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' }],
                    },
                    scene: [SymbolScene],
                },
            };
        },

        created() {
            this.initialize = true;
        },
    };
</script>

in SymbolScene.js

import Phaser from 'phaser';

export default class SymbolScene extends Phaser.Scene {
    constructor() {
        super({
            key: 'SymbolScene',
        });
    }

    preload() {
        this.load.setPath('assets/');
        this.load.image('gamePic', 'spine/game/skeleton.png');
        this.load.spine('gameSpine', 'spine/game/skeleton.json', ['spine/game/skeleton.atlas'], true);
    }

    create() {
        this.add.spine(50, 50, 'gameSpine');
    }

After update to 1.3.0, it has been solved.
Thank you.

@jdnichollsc
Copy link
Member

jdnichollsc commented Mar 16, 2021

Awesome, thanks for letting me know! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants