Skip to content

Have got a "PhaserComps.ComponentClip is not a constructor" error #5

@EOShippo

Description

@EOShippo

I followed the setup and have got a error:
Uncaught TypeError: PhaserComps.ComponentClip is not a constructor at initialize.create (project.bundle.js:1) at initialize.create (phaser.min.js:1) at initialize.loadComplete (phaser.min.js:1) at initialize.h.emit (phaser.min.js:1) at initialize.loadComplete (phaser.min.js:1) at initialize.fileProcessComplete (phaser.min.js:1) at initialize.onProcessComplete (phaser.min.js:1) at initialize.onProcess (phaser.min.js:1) at initialize.nextFile (phaser.min.js:1) at initialize.onLoad (phaser.min.js:1)
And the index.js as follow:

const COMPONENT_CONFIG = "comp-config";
const TEXTURE_CONFIG = "my_texture";


var game = new Phaser.Game({
    type: Phaser.AUTO,
    parent: "phaser-example",
    width: 800,
    height: 600,
    scene: {
        preload: preload,
        create: create
    }
});


function preload() {
    this.load.json(COMPONENT_CONFIG, "assets/WindowTest.json");
    //this.load.multiatlas(TEXTURE_CONFIG, "assets/atlases/my_atlas.json", "assets/atlases/");
}

function create() {
    let clip = new PhaserComps.ComponentClip(
        this,
        this.cache.json.get(COMPONENT_CONFIG),
        [ TEXTURE_CONFIG ]
    );

    let component = new PhaserComps.UIComponents.UIComponentPrototype();
    component.appendClip(clip);
}

And if I just tested the phaser code,it worked just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions