-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
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
Labels
No labels