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

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

Open
EOShippo opened this issue Jan 16, 2020 · 0 comments
Open

Comments

@EOShippo
Copy link

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.

@EOShippo EOShippo changed the title Have go a "PhaserComps.ComponentClip is not a constructor" error Have got a "PhaserComps.ComponentClip is not a constructor" error Jan 16, 2020
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

1 participant